Explorar el Código

dpkg-deb: Do not use EOF on file descriptor calls

The code was working because EOF is usually -1, but that's not
guaranteed by any standard. It's also conceptually wrong to mix this
definition from stream based I/O on file dscriptor based I/O.

For the close() call, just check that the return value is not 0.

Regression introduced in f4f4a1aa8dec678b6f34abcbcb8efd5b75966028.
Guillem Jover hace 16 años
padre
commit
df863c9b8d
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      dpkg-deb/extract.c

+ 1 - 1
dpkg-deb/extract.c

@@ -257,7 +257,7 @@ void extracthalf(const char *debar, const char *directory,
   if (!c1) {
     close(p1[0]);
     stream_fd_copy(ar, p1[1], memberlen, _("failed to write to pipe in copy"));
-    if (close(p1[1]) == EOF)
+    if (close(p1[1]))
       ohshite(_("failed to close pipe in copy"));
     exit(0);
   }