version 1.18, 2005/10/13 05:24:52 |
version 1.19, 2005/10/13 20:28:49 |
|
|
char *buf; |
char *buf; |
size_t len; |
size_t len; |
int ret; |
int ret; |
char *wdir, cwd[NFILEN]; |
char *wdir, cwd[NFILEN]; |
char timestr[NTIME]; |
char timestr[NTIME]; |
time_t t; |
time_t t; |
|
|
|
|
if (chdir(path) == -1) { |
if (chdir(path) == -1) { |
ewprintf("Can't change dir to %s", path); |
ewprintf("Can't change dir to %s", path); |
return (NULL); |
return (NULL); |
} |
} |
if ((pipe = popen(command, "r")) == NULL) { |
if ((pipe = popen(command, "r")) == NULL) { |
ewprintf("Problem opening pipe"); |
ewprintf("Problem opening pipe"); |
return (NULL); |
return (NULL); |
|
|
if (chdir(cwd) == -1) { |
if (chdir(cwd) == -1) { |
ewprintf("Can't change dir back to %s", cwd); |
ewprintf("Can't change dir back to %s", cwd); |
return (NULL); |
return (NULL); |
} |
} |
return (bp); |
return (bp); |
} |
} |
|
|