popen.c (17478) | popen.c (18449) |
---|---|
1/* 2 * Copyright (c) 1988, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software written by Ken Arnold and 6 * published in UNIX Review, Vol. 6, No. 8. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 56 unchanged lines hidden (view full) --- 65ftpd_popen(program, type) 66 char *program, *type; 67{ 68 char *cp; 69 FILE *iop; 70 int argc, gargc, pdes[2], pid; 71 char **pop, *argv[100], *gargv[1000]; 72 | 1/* 2 * Copyright (c) 1988, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software written by Ken Arnold and 6 * published in UNIX Review, Vol. 6, No. 8. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 56 unchanged lines hidden (view full) --- 65ftpd_popen(program, type) 66 char *program, *type; 67{ 68 char *cp; 69 FILE *iop; 70 int argc, gargc, pdes[2], pid; 71 char **pop, *argv[100], *gargv[1000]; 72 |
73 if (*type != 'r' && *type != 'w' || type[1]) | 73 if (((*type != 'r') && (*type != 'w')) || type[1]) |
74 return (NULL); 75 76 if (!pids) { 77 if ((fds = getdtablesize()) <= 0) 78 return (NULL); 79 if ((pids = (int *)malloc((u_int)(fds * sizeof(int)))) == NULL) 80 return (NULL); 81 memset(pids, 0, fds * sizeof(int)); --- 91 unchanged lines hidden --- | 74 return (NULL); 75 76 if (!pids) { 77 if ((fds = getdtablesize()) <= 0) 78 return (NULL); 79 if ((pids = (int *)malloc((u_int)(fds * sizeof(int)))) == NULL) 80 return (NULL); 81 memset(pids, 0, fds * sizeof(int)); --- 91 unchanged lines hidden --- |