diff --git a/lib/libcasper/libcasper/service.c b/lib/libcasper/libcasper/service.c index 52318121cbb0..cc53d0d630ae 100644 --- a/lib/libcasper/libcasper/service.c +++ b/lib/libcasper/libcasper/service.c @@ -360,7 +360,8 @@ stdnull(void) if (dup2(fd, STDERR_FILENO) == -1) errx(1, "Unable to cover stderr"); - close(fd); + if (fd > STDERR_FILENO) + close(fd); } static void