View | Details | Raw Unified | Return to bug 274509
Collapse All | Expand All

(-)b/tools/rsyslogd.c (-7 lines)
Lines 461-478 prepareBackground(const int parentPipeFD) Link Here
461
		if(close_unneeded_open_files("/proc/fd", beginClose, parentPipeFD) != 0) {
461
		if(close_unneeded_open_files("/proc/fd", beginClose, parentPipeFD) != 0) {
462
			/* did not work out, so let's close everything... */
462
			/* did not work out, so let's close everything... */
463
			const int endClose = getdtablesize();
463
			const int endClose = getdtablesize();
464
#		if defined(HAVE_CLOSE_RANGE)
465
			if(close_range(beginClose, endClose, 0) != 0) {
466
				dbgprintf("errno %d after close_range(), fallback to loop\n", errno);
467
#		endif
468
				for(int i = beginClose ; i <= endClose ; ++i) {
464
				for(int i = beginClose ; i <= endClose ; ++i) {
469
					if((i != dbgGetDbglogFd()) && (i != parentPipeFD)) {
465
					if((i != dbgGetDbglogFd()) && (i != parentPipeFD)) {
470
						  aix_close_it(i); /* AIXPORT */
466
						  aix_close_it(i); /* AIXPORT */
471
					}
472
				}
467
				}
473
#		if defined(HAVE_CLOSE_RANGE)
474
			}
468
			}
475
#		endif
476
		}
469
		}
477
	}
470
	}
478
	seedRandomNumberForChild();
471
	seedRandomNumberForChild();

Return to bug 274509