contrib/chg/chg.c
branchstable
changeset 45851 81da6feb5000
parent 45850 9534de20358f
child 46177 0c320e6032f1
equal deleted inserted replaced
45850:9534de20358f 45851:81da6feb5000
   274 	DIR *dp = opendir("/proc/self/fd");
   274 	DIR *dp = opendir("/proc/self/fd");
   275 	if (dp != NULL) {
   275 	if (dp != NULL) {
   276 		debugmsg("closing files based on /proc contents");
   276 		debugmsg("closing files based on /proc contents");
   277 		struct dirent *de;
   277 		struct dirent *de;
   278 		while ((de = readdir(dp))) {
   278 		while ((de = readdir(dp))) {
       
   279 			errno = 0;
   279 			char *end;
   280 			char *end;
   280 			long fd_value = strtol(de->d_name, &end, 10);
   281 			long fd_value = strtol(de->d_name, &end, 10);
   281 			if (end == de->d_name) {
   282 			if (end == de->d_name) {
   282 				/* unable to convert to int (. or ..) */
   283 				/* unable to convert to int (. or ..) */
   283 				continue;
   284 				continue;