diff options
-rw-r--r-- | plugins/popen.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/popen.c b/plugins/popen.c index d056904d..d4151e61 100644 --- a/plugins/popen.c +++ b/plugins/popen.c | |||
@@ -203,24 +203,24 @@ spclose (FILE * fp) | |||
203 | pid_t pid; | 203 | pid_t pid; |
204 | 204 | ||
205 | if (childpid == NULL) | 205 | if (childpid == NULL) |
206 | return (-1); /* popen() has never been called */ | 206 | return (1); /* popen() has never been called */ |
207 | 207 | ||
208 | fd = fileno (fp); | 208 | fd = fileno (fp); |
209 | if ((pid = childpid[fd]) == 0) | 209 | if ((pid = childpid[fd]) == 0) |
210 | return (-1); /* fp wasn't opened by popen() */ | 210 | return (1); /* fp wasn't opened by popen() */ |
211 | 211 | ||
212 | childpid[fd] = 0; | 212 | childpid[fd] = 0; |
213 | if (fclose (fp) == EOF) | 213 | if (fclose (fp) == EOF) |
214 | return (-1); | 214 | return (1); |
215 | 215 | ||
216 | while (waitpid (pid, &stat, 0) < 0) | 216 | while (waitpid (pid, &stat, 0) < 0) |
217 | if (errno != EINTR) | 217 | if (errno != EINTR) |
218 | return (-1); /* error other than EINTR from waitpid() */ | 218 | return (1); /* error other than EINTR from waitpid() */ |
219 | 219 | ||
220 | if (WIFEXITED (stat)) | 220 | if (WIFEXITED (stat)) |
221 | return (WEXITSTATUS (stat)); /* return child's termination status */ | 221 | return (WEXITSTATUS (stat)); /* return child's termination status */ |
222 | 222 | ||
223 | return (STATE_UNKNOWN); | 223 | return (1); |
224 | } | 224 | } |
225 | 225 | ||
226 | #ifdef OPEN_MAX | 226 | #ifdef OPEN_MAX |