diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-06-10 14:11:53 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-06-10 14:11:53 +0300 |
commit | 588fbc95959785566d6929784d73db9c167433a1 (patch) | |
tree | b62284a5767abe088c474494eebc2e3e5de47fde /tests | |
parent | c4dbd40477bb658cdc5c5e01b8f80057e587cd88 (diff) | |
download | pies-588fbc95959785566d6929784d73db9c167433a1.tar.gz pies-588fbc95959785566d6929784d73db9c167433a1.tar.bz2 |
Bugfix
* tests/nt.c: Trivial fixes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/nt.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -282,19 +282,19 @@ netcat (char const *urlstr) | |||
282 | 282 | ||
283 | static void | 283 | static void |
284 | redirect (int sfd, char const *name) | 284 | redirect (int sfd, char const *name) |
285 | { | 285 | { |
286 | int fd; | 286 | int fd; |
287 | 287 | ||
288 | fd = open (name, sfd ? (O_WRONLY | O_TRUNC) : O_RDONLY); | 288 | fd = open (name, sfd ? (O_CREAT | O_TRUNC | O_WRONLY) : O_RDONLY, 0644); |
289 | if (!fd) | 289 | if (fd == -1) |
290 | { | 290 | { |
291 | perror (name); | 291 | perror (name); |
292 | exit (1); | 292 | exit (1); |
293 | } | 293 | } |
294 | if (dup2 (fd, sfd)) | 294 | if (dup2 (fd, sfd) == -1) |
295 | { | 295 | { |
296 | perror ("dup2"); | 296 | perror ("dup2"); |
297 | exit (1); | 297 | exit (1); |
298 | } | 298 | } |
299 | } | 299 | } |
300 | 300 | ||