/*
- * 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.
*/
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;