]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - grab_client.c
write: Improve help text of --writer.
[paraslash.git] / grab_client.c
index f4bcbb79d104a4752a8a5fa22df2c3a5cc6515fe..0ef1c15f33593b9067e385a5c1aab65dcf66f0cd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006-2014 Andre Noll <maan@tuebingen.mpg.de>
+ * Copyright (C) 2006 Andre Noll <maan@tuebingen.mpg.de>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -284,7 +284,12 @@ int grab_client_new(int fd, int argc, char **argv, struct sched *s)
        ret = gc_check_args(argc, argv, gc);
        if (ret < 0)
                goto err_out;
-       gc->fd = fd;
+       ret = dup(fd);
+       if (ret < 0) {
+               ret = -ERRNO_TO_PARA_ERROR(errno);
+               goto err_out;
+       }
+       gc->fd = ret;
        para_list_add(&gc->node, &inactive_grab_client_list);
        gc_activate(gc, s);
        return 1;