X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=grab_client.c;h=0ef1c15f33593b9067e385a5c1aab65dcf66f0cd;hp=7948c44957cdf7f8d28e40c7d3253b385969adf6;hb=a23e12ae76608a7ba3d333d8d76d5bbba0ba3ef0;hpb=879e52d49df6d00aa9eafe5cccb48bbd24ed4c81 diff --git a/grab_client.c b/grab_client.c index 7948c449..0ef1c15f 100644 --- a/grab_client.c +++ b/grab_client.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2014 Andre Noll + * Copyright (C) 2006 Andre Noll * * 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;