[dhcp-agent-commits] dhcp-agent/src dhcp-files.c,1.8,1.9 dhcp-local.h,1.6,1.7 dhcp-snprintf.c,1.3,1.
Status: Alpha
Brought to you by:
actmodern
From: <act...@us...> - 2003-06-11 03:08:54
|
Update of /cvsroot/dhcp-agent/dhcp-agent/src In directory sc8-pr-cvs1:/tmp/cvs-serv23366/src Modified Files: dhcp-files.c dhcp-local.h dhcp-snprintf.c Log Message: fixes for solaris Index: dhcp-files.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-files.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dhcp-files.c 29 Dec 2002 05:17:49 -0000 1.8 --- dhcp-files.c 11 Jun 2003 03:08:48 -0000 1.9 *************** *** 161,165 **** ! fprintf(fp, "%u", getpid()); fclose(fp); --- 161,165 ---- ! fprintf(fp, "%lu", (unsigned long)getpid()); fclose(fp); *************** *** 181,189 **** /* get pid from file. */ ! int file_get_pid(char *name, pid_t * pid) { FILE *fp; char *fname = get_pid_file_name(name); if(!file_exists(fname)) { xfree(fname); --- 181,191 ---- /* get pid from file. */ ! int file_get_pid(char *name, pid_t *pid) { FILE *fp; + unsigned long pid_value; char *fname = get_pid_file_name(name); + if(!file_exists(fname)) { xfree(fname); *************** *** 198,205 **** } ! fscanf(fp, "%u", pid); fclose(fp); xfree(fname); return 0; } --- 200,209 ---- } ! /* probably a safe cast since we're most likely promoting. */ ! fscanf(fp, "%ld", &pid_value); fclose(fp); xfree(fname); + *pid = pid_value; return 0; } Index: dhcp-local.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-local.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** dhcp-local.h 9 Jun 2003 02:04:02 -0000 1.6 --- dhcp-local.h 11 Jun 2003 03:08:49 -0000 1.7 *************** *** 53,57 **** #include <sys/time.h> #include <sys/ioctl.h> ! #include <sys/fcntl.h> #include <sys/uio.h> --- 53,57 ---- #include <sys/time.h> #include <sys/ioctl.h> ! #include <fcntl.h> #include <sys/uio.h> *************** *** 107,110 **** --- 107,123 ---- #define INADDR_NONE -1 #endif /* INADDR_NONE */ + + /* Some operating systems don't have SCNu8/SCNd8 but will have + * the other C99 format macros. I guess they expect us just to + * use normal character substitution. So we will. Otherwise + * they're borked. */ + + #ifndef SCNu8 + #define SCNu8 "hhu" + #endif /* SCNu8 */ + + #ifndef SCNi8 + #define SCNi8 "hhi" + #endif /* SCNi8 */ #endif /* DHCP_LOCAL_H */ Index: dhcp-snprintf.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/src/dhcp-snprintf.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dhcp-snprintf.c 16 Nov 2002 00:23:44 -0000 1.3 --- dhcp-snprintf.c 11 Jun 2003 03:08:49 -0000 1.4 *************** *** 6,9 **** --- 6,20 ---- */ + /********************************************************* + * Taken from the mutt project. + * Recent changes: + * + * Thamer Alharbash <tm...@wh...>, June, 2003: + * + * Some minor tweaks to keep it healthy on newer gcc, and + * platforms like Solaris. + * + *********************************************************/ + /************************************************************** * Original: *************** *** 198,202 **** break; case DP_S_MIN: ! if(isdigit(ch)) { min = 10 * min + char_to_int(ch); ch = *format++; --- 209,213 ---- break; case DP_S_MIN: ! if(isdigit((int)ch)) { min = 10 * min + char_to_int(ch); ch = *format++; *************** *** 216,220 **** break; case DP_S_MAX: ! if(isdigit(ch)) { if(max < 0) max = 0; --- 227,231 ---- break; case DP_S_MAX: ! if(isdigit((int)ch)) { if(max < 0) max = 0; |