X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=httpinput.cpp;h=75cf99b9c8de73983e039bd2061dd7ef2da20c96;hb=edc6342c5106959a01f5e2d08a7cb95b3c24de9c;hp=a972fa2ca9eb7d4b8783bc72fb5b2cda647bcd85;hpb=5c2e4453f2f807a8ef3094902a1fc5544486c89a;p=cubemap diff --git a/httpinput.cpp b/httpinput.cpp index a972fa2..75cf99b 100644 --- a/httpinput.cpp +++ b/httpinput.cpp @@ -80,7 +80,9 @@ HTTPInput::HTTPInput(const InputProto &serialized) { // Set back the close-on-exec flag for the socket. // (This can't leak into a child, since we haven't been started yet.) - fcntl(sock, F_SETFD, O_CLOEXEC); + if (sock != -1) { + fcntl(sock, F_SETFD, O_CLOEXEC); + } pending_data.resize(serialized.pending_data().size()); memcpy(&pending_data[0], serialized.pending_data().data(), serialized.pending_data().size());