Changeset 362
- Timestamp:
- Oct 19, 2011, 12:16:31 AM (13 years ago)
- Location:
- trunk/src
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/dnmalloc.c
r279 r362 6 6 Email: dnmalloc@fort-knox.org 7 7 Address: 8 #if defined(WITH_TPT) 8 9 Yves Younan 9 10 Celestijnenlaan 200A … … 4508 4509 4509 4510 else { 4511 #if PARANOIA > 0 4510 4512 int ret; 4513 #endif 4511 4514 INTERNAL_SIZE_T offset = (INTERNAL_SIZE_T) p->hash_next; 4512 4515 av->n_mmaps--; 4513 4516 av->mmapped_mem -= (size + offset); 4517 #if PARANOIA > 0 4514 4518 ret = munmap((char*) chunk(p) - offset, size + offset); 4519 #else 4520 munmap((char*) chunk(p) - offset, size + offset); 4521 #endif 4515 4522 hashtable_remove_mmapped(chunk(p)); 4516 4523 freecilst_add(p); … … 5007 5014 CHUNK_SIZE_T remainder_size; /* its size */ 5008 5015 INTERNAL_SIZE_T size; 5016 #if PARANOIA > 2 5009 5017 mstate av; 5018 #endif 5010 5019 5011 5020 /* If need less alignment than we give anyway, just relay to malloc */ … … 5038 5047 if (m == 0) return 0; /* propagate failure */ 5039 5048 5049 #if PARANOIA > 2 5040 5050 av = get_malloc_state(); 5051 #endif 5041 5052 5042 5053 p = hashtable_lookup((mchunkptr) m); -
trunk/src/sh_database.c
r296 r362 1244 1244 char * values; 1245 1245 1246 int status;1247 1246 long the_id; 1248 1247 int size; … … 1445 1444 db_table, columns, values); 1446 1445 1447 s tatus = sh_database_query (query, &the_id);1446 sh_database_query (query, &the_id); 1448 1447 1449 1448 /*@-usedef@*//* no, 'values' is allocated here */ -
trunk/src/sh_err_console.c
r252 r362 69 69 { 70 70 key_t key; 71 int error; 72 #if defined(WITH_TPT) 71 #if defined(WITH_TPT) 72 int error = 0; 73 73 char errbuf[SH_ERRBUF_SIZE]; 74 74 #endif … … 81 81 if (key == (key_t) -1) 82 82 { 83 #if defined(WITH_TPT) 83 84 error = errno; 85 #endif 84 86 TPT(( 0, FIL__, __LINE__, _("msg=<ftok: %s> errno=<%d>\n"), 85 87 sh_error_message(error, errbuf, sizeof(errbuf)), error)); … … 93 95 if (msgid < 0) 94 96 { 97 #if defined(WITH_TPT) 95 98 error = errno; 99 #endif 96 100 TPT(( 0, FIL__, __LINE__, _("msg=<msgget: %s> errno=<%d>\n"), 97 101 sh_error_message(error, errbuf, sizeof(errbuf)), error)); … … 132 136 int rc = -1; 133 137 static int status = -1; 134 int error;135 138 int count = 0; 136 139 #if defined(WITH_TPT) 140 int error = 0; 137 141 char errbuf[SH_ERRBUF_SIZE]; 138 142 #endif … … 205 209 else 206 210 { 211 #if defined(WITH_TPT) 207 212 error = errno; 213 #endif 208 214 TPT(( 0, FIL__, __LINE__, _("msg=<msgsnd: %s> errno=<%d>\n"), 209 215 sh_error_message(error, errbuf, sizeof(errbuf)), error)); -
trunk/src/sh_files.c
r356 r362 76 76 static char * sh_files_C_dequote (char * s, size_t * length) 77 77 { 78 size_t i, j,len = *length;78 size_t i, len = *length; 79 79 int flag = 0; 80 80 char *p, *q, *po, *pend; … … 96 96 po = SH_ALLOC(len+1); *po = '\0'; p = po; pend = &po[len]; 97 97 98 i = 0; j = 0;q = s;98 i = 0; q = s; 99 99 100 100 do -
trunk/src/sh_hash.c
r356 r362 435 435 char hashbuf[KEYBUF_SIZE]; 436 436 int retval; 437 volatile int flag = 0;438 437 439 438 /* -------- find the entry for the file ---------------- */ … … 462 461 sh_error_handle (level, FIL__, __LINE__, 0, 463 462 MSG_FI_MISS2, tmp, str); 464 flag = 1; 463 465 464 SH_FREE(tmp); 466 465 SH_FREE(str); … … 1302 1301 extern int get_the_fd (SL_TICKET ticket); 1303 1302 1304 int flag_pgp;1305 int flag_nohead;1306 1303 SL_TICKET fdTmp = (-1); 1307 1304 #endif … … 1314 1311 1315 1312 SH_MUTEX_LOCK(mutex_hash); 1316 1317 #if defined(WITH_GPG) || defined(WITH_PGP)1318 flag_pgp = S_FALSE;1319 flag_nohead = S_FALSE;1320 #endif1321 1313 1322 1314 if (IsInit == 1) … … 3885 3877 size_t size = 0; 3886 3878 size_t flag_quote = 0; 3887 int flag_comma = 0; 3879 3888 3880 char * new; 3889 3881 char * pnew; … … 3894 3886 while (*p) 3895 3887 { 3896 if (*p == ',') 3897 flag_comma = 1; 3898 else if (*p == '"') 3888 if (*p == '"') 3899 3889 ++flag_quote; 3900 3890 -
trunk/src/sh_kern.c
r348 r362 848 848 849 849 unsigned short idt_offset_lo, idt_offset_hi, idt_selector; 850 unsigned char idt_reserved,idt_flag;850 unsigned char /* idt_reserved, */ idt_flag; 851 851 unsigned short sh_idt_offset_lo, sh_idt_offset_hi, sh_idt_selector; 852 unsigned char sh_idt_reserved,sh_idt_flag;852 unsigned char /* sh_idt_reserved, */ sh_idt_flag; 853 853 int dpl; 854 854 unsigned long idt_iaddr; … … 889 889 sh_idt_offset_lo = *((unsigned short *) &sh_idt_table[i]); 890 890 sh_idt_selector = *((unsigned short *) &sh_idt_table[i+2]); 891 sh_idt_reserved = (unsigned char) sh_idt_table[i+4];891 /* sh_idt_reserved = (unsigned char) sh_idt_table[i+4]; */ 892 892 sh_idt_flag = (unsigned char) sh_idt_table[i+5]; 893 893 sh_idt_offset_hi = *((unsigned short *) &sh_idt_table[i+6]); … … 919 919 idt_offset_lo = *((unsigned short *) &idt_table[i]); 920 920 idt_selector = *((unsigned short *) &idt_table[i+2]); 921 idt_reserved = (unsigned char) idt_table[i+4];921 /* idt_reserved = (unsigned char) idt_table[i+4]; */ 922 922 idt_flag = (unsigned char) idt_table[i+5]; 923 923 idt_offset_hi = *((unsigned short *) &idt_table[i+6]); -
trunk/src/sh_log_check.c
r358 r362 1027 1027 * Reader for binary files 1028 1028 */ 1029 sh_string * sh_binary_reader (void * s, size_t size, struct sh_logfile * logfile) 1029 sh_string * sh_binary_reader (void * s, size_t size, 1030 struct sh_logfile * logfile) 1030 1031 { 1031 1032 size_t status; … … 1040 1041 if (status != 1) 1041 1042 { 1043 memset(s, '\0', size); 1042 1044 if (ferror(logfile->fp) && (logfile->flags & SH_LOGFILE_PIPE) == 0) 1043 1045 { … … 1053 1055 sl_fclose(FIL__, __LINE__, logfile->fp); 1054 1056 logfile->fp = NULL; 1055 memset(s, '\0', size);1056 1057 return NULL; 1057 1058 } … … 1387 1388 retval = -1; 1388 1389 } 1389 1390 sh_logmon_interval = (time_t) val; 1391 SL_RETURN(0, _("sh_logmon_set_interval")); 1390 else 1391 { 1392 sh_logmon_interval = (time_t) val; 1393 } 1394 SL_RETURN(retval, _("sh_logmon_set_interval")); 1392 1395 } 1393 1396 -
trunk/src/sh_log_parse_apache.c
r357 r362 65 65 static void * sh_dummy_new = NULL; 66 66 static void * sh_dummy_fti = NULL; 67 static void * sh_dummy_ftr = NULL; 67 68 68 69 void * sh_eval_fileinfo_apache(char * str) … … 89 90 sh_dummy_new = (void*) &new; 90 91 sh_dummy_fti = (void*) &f_time; 92 sh_dummy_ftr = (void*) &result; 91 93 92 94 if (0 == strncmp("common", str, 6)) -
trunk/src/sh_log_parse_generic.c
r301 r362 47 47 { 48 48 struct tm ts; 49 struct tm * ts_p;50 49 char tmp[80]; 51 50 size_t len; … … 54 53 55 54 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R) 56 ts_p =localtime_r (&(record->timestamp), &ts);55 localtime_r (&(record->timestamp), &ts); 57 56 #else 58 ts_p = localtime (&(record->timestamp)); 59 memcpy(&ts, ts_p, sizeof(struct tm)); 57 memcpy(&ts, localtime(&(record->timestamp)), sizeof(struct tm)); 60 58 #endif 61 59 len = strftime(tmp, sizeof(tmp), _("%Y-%m-%dT%H:%M:%S"), &ts); -
trunk/src/sh_mail.c
r295 r362 1863 1863 static dnsrep * return_mx (char *domain) 1864 1864 { 1865 struct hostent *host;1866 1865 dnsrep * answers = NULL; 1867 1866 mx * result; … … 1908 1907 1909 1908 retval = NULL; 1910 host = NULL;1911 1909 1912 1910 if (domain != NULL) -
trunk/src/sh_portcheck.c
r335 r362 193 193 retval = -1; 194 194 } 195 196 sh_portchk_interval = (time_t) val; 197 SL_RETURN(0, _("sh_portchk_set_interval")); 195 else 196 { 197 sh_portchk_interval = (time_t) val; 198 } 199 SL_RETURN(retval, _("sh_portchk_set_interval")); 198 200 } 199 201 … … 213 215 retval = -1; 214 216 } 215 216 *setthis = (int) val; 217 SL_RETURN(0, _("sh_portchk_set_port_minmax")); 217 else 218 { 219 *setthis = (int) val; 220 } 221 SL_RETURN(retval, _("sh_portchk_set_port_minmax")); 218 222 } 219 223 -
trunk/src/sh_processcheck.c
r338 r362 632 632 retval = -1; 633 633 } 634 635 sh_prochk_interval = (time_t) val; 636 SL_RETURN(0, _("sh_prochk_set_interval")); 634 else 635 { 636 sh_prochk_interval = (time_t) val; 637 } 638 SL_RETURN(retval, _("sh_prochk_set_interval")); 637 639 } 638 640 -
trunk/src/sh_socket.c
r315 r362 1126 1126 char * sh_socket_check(const char * client_name) 1127 1127 { 1128 struct socket_cmd * old = cmdlist;1129 1128 struct socket_cmd * new = cmdlist; 1130 1129 static char out[SH_MAXMSGLEN]; … … 1139 1138 return out; 1140 1139 } 1141 old = new;1142 1140 new = new->next; 1143 1141 } -
trunk/src/sh_unix.c
r343 r362 2169 2169 struct tm aa; 2170 2170 struct tm bb; 2171 struct tm * cc; 2171 2172 2172 int sign = 0; 2173 2173 int diff = 0; … … 2178 2178 2179 2179 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GMTIME_R) 2180 cc = gmtime_r (xx, &aa); 2181 #else 2182 cc = gmtime (xx); 2183 memcpy (&aa, cc, sizeof(struct tm)); 2180 gmtime_r (xx, &aa); 2181 #else 2182 memcpy (&aa, gmtime(xx), sizeof(struct tm)); 2184 2183 #endif 2185 2184 2186 2185 #if defined(HAVE_PTHREAD) && defined (_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_LOCALTIME_R) 2187 cc = localtime_r (xx, &bb); 2188 #else 2189 cc = localtime (xx); 2190 memcpy (&bb, cc, sizeof(struct tm)); 2186 localtime_r (xx, &bb); 2187 #else 2188 memcpy (&bb, localtime(xx), sizeof(struct tm)); 2191 2189 #endif 2192 2190
Note:
See TracChangeset
for help on using the changeset viewer.