diff options
| author | Jeremy Allison <jra@samba.org> | 2000-10-08 21:21:27 +0000 | 
|---|---|---|
| committer | Jeremy Allison <jra@samba.org> | 2000-10-08 21:21:27 +0000 | 
| commit | 33170cc6fb1b00d573d8e3fcea3fbd43080eb153 (patch) | |
| tree | 6eedf304c4b3c8a6f857b9ee3a170affbeb589b2 | |
| parent | 5ad18c79ad380596159f729a97d42100074425a6 (diff) | |
| download | samba-33170cc6fb1b00d573d8e3fcea3fbd43080eb153.tar.gz samba-33170cc6fb1b00d573d8e3fcea3fbd43080eb153.tar.bz2 samba-33170cc6fb1b00d573d8e3fcea3fbd43080eb153.zip  | |
sys_popen got damaged when converted from FILE * to int fd I think.
Patrick Powell kindly pointed out the bug.
Jeremy.
(This used to be commit 1f156b2420b7ecf1266e650efc3cee55362e29dd)
| -rw-r--r-- | source3/lib/system.c | 17 | 
1 files changed, 3 insertions, 14 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c index e846e4755e..0c8e7ddcfc 100644 --- a/source3/lib/system.c +++ b/source3/lib/system.c @@ -908,6 +908,8 @@ int sys_popen(const char *command)  	if((entry = (popen_list *)malloc(sizeof(popen_list))) == NULL)  		goto err_exit; +	ZERO_STRUCTP(entry); +  	/*  	 * Extract the command and args into a NULL terminated array.  	 */ @@ -959,6 +961,7 @@ int sys_popen(const char *command)  	/* Link into popen_chain. */  	entry->next = popen_chain;  	popen_chain = entry; +	entry->fd = parent_end;  	return entry->fd; @@ -1013,17 +1016,3 @@ int sys_pclose(int fd)  		return -1;  	return wstatus;  } - - - -#if GLIBC_HACK_FCNTL64 -#include <asm/unistd.h> -/* this is a gross hack. 64 bit locking is completely screwed up on -   i386 Linux in glibc 2.1.95 (which ships with RedHat 7.0). This hack -   "fixes" the problem with the current 2.4.0test kernels  -*/ -int fcntl64(int fd, int cmd, struct flock * lock) -{ -	return syscall(__NR_fcntl64, fd, cmd, lock); -} -#endif /* HACK_FCNTL64 */  | 
