47#define CVT_BUF_MAX 1023
53 FILE *
file = fopen(
"/etc/os-release",
"r");
59 url = (
char *) malloc(url_len *
sizeof(
char));
60 strcpy(url,
"https://bugzilla.redhat.com/");
65 while ((getline(&
line, &len,
file)) != -1) {
66 if (strstr(
line,
"BUG_REPORT_URL") != NULL) {
67 char * start = strchr(
line,
'=');
68 char * rquotes = strrchr(
line,
'"');
70 if (rquotes != NULL) {
72 strncpy(url, start+2, url_len);
74 strncpy(url, start+1, url_len);
76 url[url_len-1] =
'\0';
98 vsnprintf (mbuf,
sizeof mbuf, fbuf, list);
102 syslog (LOG_ERR,
"%s", mbuf);
112 log_error (
"This version of ISC DHCP is based on the release available");
113 log_error (
"on ftp.isc.org. Features have been added and other changes");
114 log_error (
"have been made to the base software release in order to make");
115 log_error (
"it work better with this distribution.");
117 log_error (
"Please report issues with this software via: ");
138 va_start (list, fmt);
139 vsnprintf (mbuf,
sizeof mbuf, fbuf, list);
143 syslog (LOG_ERR,
"%s", mbuf);
165 va_start (list, fmt);
166 vsnprintf (mbuf,
sizeof mbuf, fbuf, list);
170 syslog (LOG_INFO,
"%s", mbuf);
192 va_start (list, fmt);
193 vsnprintf (mbuf,
sizeof mbuf, fbuf, list);
197 syslog (LOG_DEBUG,
"%s", mbuf);
215 const char *s = ibuf;
225 m = strerror (errno);
230 m =
"<unknown error>";
232 if (len > obufsize - 1)
238 if (++len > obufsize - 1)
246 if (++len > obufsize - 1)
259 extern char *sys_errlist [];
261 static char errbuf [128];
263 if (err < 0 || err >= sys_nerr) {
264 sprintf (errbuf,
"Error %d", err);
267 return sys_errlist [err];
274 int err = WSAGetLastError ();
279 return "Permission denied";
281 return "Address already in use";
282 case WSAEADDRNOTAVAIL:
283 return "Cannot assign requested address";
284 case WSAEAFNOSUPPORT:
285 return "Address family not supported by protocol family";
287 return "Operation already in progress";
288 case WSAECONNABORTED:
289 return "Software caused connection abort";
290 case WSAECONNREFUSED:
291 return "Connection refused";
293 return "Connection reset by peer";
294 case WSAEDESTADDRREQ:
295 return "Destination address required";
297 return "Bad address";
299 return "Host is down";
300 case WSAEHOSTUNREACH:
301 return "No route to host";
303 return "Operation now in progress";
305 return "Interrupted function call";
307 return "Invalid argument";
309 return "Socket is already connected";
311 return "Too many open files";
313 return "Message too long";
315 return "Network is down";
317 return "Network dropped connection on reset";
319 return "Network is unreachable";
321 return "No buffer space available";
323 return "Bad protocol option";
325 return "Socket is not connected";
327 return "Socket operation on non-socket";
329 return "Operation not supported";
330 case WSAEPFNOSUPPORT:
331 return "Protocol family not supported";
333 return "Too many processes";
334 case WSAEPROTONOSUPPORT:
335 return "Protocol not supported";
337 return "Protocol wrong type for socket";
339 return "Cannot send after socket shutdown";
340 case WSAESOCKTNOSUPPORT:
341 return "Socket type not supported";
343 return "Connection timed out";
345 return "Resource temporarily unavailable";
346 case WSAHOST_NOT_FOUND:
347 return "Host not found";
349 case WSA_INVALID_HANDLE:
350 return "Specified event object handle is invalid";
351 case WSA_INVALID_PARAMETER:
352 return "One or more parameters are invalid";
353 case WSAINVALIDPROCTABLE:
354 return "Invalid procedure table from service provider";
355 case WSAINVALIDPROVIDER:
356 return "Invalid service provider version number";
358 return "Overlapped operations will complete later";
359 case WSA_IO_INCOMPLETE:
360 return "Overlapped I/O event object not in signaled state";
361 case WSA_NOT_ENOUGH_MEMORY:
362 return "Insufficient memory available";
364 case WSANOTINITIALISED:
365 return "Successful WSAStartup not yet performer";
367 return "Valid name, no data record of requested type";
369 return "This is a non-recoverable error";
371 case WSAPROVIDERFAILEDINIT:
372 return "Unable to initialize a service provider";
373 case WSASYSCALLFAILURE:
374 return "System call failure";
377 return "Network subsystem is unavailable";
379 return "Non-authoritative host not found";
380 case WSAVERNOTSUPPORTED:
381 return "WINSOCK.DLL version out of range";
383 return "Graceful shutdown in progress";
385 case WSA_OPERATION_ABORTED:
386 return "Overlapped operation aborted";
389 return "Unknown WinSock error";
int log_debug(const char *fmt,...)
void do_percentm(char *obuf, size_t obufsize, const char *ibuf)
void log_fatal(const char *fmt,...)
int log_info(const char *fmt,...)
int log_error(const char *fmt,...)
char * bug_report_url(void)
void(* log_cleanup)(void)