Changeset 252 for trunk/src/sh_static.c
- Timestamp:
- Oct 12, 2009, 10:40:45 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_static.c
r170 r252 54 54 #include "sh_pthread.h" 55 55 56 extern int sl_close_fd (const char * file, int line, int fd); 57 extern int sl_fclose (const char * file, int line, FILE * fp); 58 59 56 60 #ifndef _PATH_PASSWD 57 61 #define _PATH_PASSWD "/etc/passwd" … … 60 64 #define _PATH_GROUP "/etc/group" 61 65 #endif 66 67 #undef FIL__ 68 #define FIL__ _("sh_static.c") 62 69 63 70 extern int sl_strlcpy(char * dst, /*@null@*/const char * src, size_t siz); … … 123 130 } 124 131 } while (1); 125 fclose(stream);132 sl_fclose(FIL__, __LINE__, stream); 126 133 } 127 134 … … 171 178 } 172 179 } while (1); 173 fclose(stream);180 sl_fclose(FIL__, __LINE__, stream); 174 181 } 175 182 … … 219 226 } 220 227 } while (1); 221 fclose(stream);228 sl_fclose(FIL__, __LINE__, stream); 222 229 } 223 230 … … 267 274 } 268 275 } while (1); 269 fclose(stream);276 sl_fclose(FIL__, __LINE__, stream); 270 277 } 271 278 … … 341 348 SH_MUTEX_LOCK(pwf_lock); 342 349 if (pwf) { 343 fclose(pwf);350 sl_fclose(FIL__, __LINE__, pwf); 344 351 pwf = NULL; 345 352 } … … 395 402 SH_MUTEX_LOCK(grf_lock); 396 403 if (grf) { 397 fclose(grf);404 sl_fclose(FIL__, __LINE__, grf); 398 405 grf = NULL; 399 406 } … … 498 505 rv = setgroups(num_groups, group_list); 499 506 DO_CLOSE: 500 fclose(grf);507 sl_fclose(FIL__, __LINE__, grf); 501 508 } 502 509 … … 863 870 #include <arpa/inet.h> 864 871 865 /* close()872 /* sl_close_fd(FIL__, __LINE__, ) 866 873 */ 867 874 #include <unistd.h> … … 1185 1192 while (retries++ < MAX_RETRIES) { 1186 1193 if (fd != -1) 1187 close(fd);1194 sl_close_fd(FIL__, __LINE__, fd); 1188 1195 1189 1196 memset(packet, 0, PACKETSZ); … … 1344 1351 DPRINTF("Answer type = |%d|\n", a->atype); 1345 1352 1346 close(fd);1353 sl_close_fd(FIL__, __LINE__, fd); 1347 1354 1348 1355 if (outpacket) … … 1390 1397 fail: 1391 1398 if (fd != -1) 1392 close(fd);1399 sl_close_fd(FIL__, __LINE__, fd); 1393 1400 if (lookup) 1394 1401 free(lookup); … … 1546 1553 1547 1554 if (action!=GETHOSTENT) { 1548 fclose(fp);1555 sl_fclose(FIL__, __LINE__, fp); 1549 1556 } 1550 1557 return ret; 1551 1558 } 1552 1559 if (action!=GETHOSTENT) { 1553 fclose(fp);1560 sl_fclose(FIL__, __LINE__, fp); 1554 1561 } 1555 1562 return ret; … … 1619 1626 } 1620 1627 } 1621 fclose(fp);1628 sl_fclose(FIL__, __LINE__, fp); 1622 1629 } else { 1623 1630 DPRINTF("failed to open %s\n", "resolv.conf");
Note:
See TracChangeset
for help on using the changeset viewer.