X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fopen.c;fp=lib%2Fopen.c;h=f612b802d2185505b2aa19cc72290ab790190cba;hb=a2016c1de6e4884f6c8ed5cc498f3bf821c25ca4;hp=8027b473a5a385816248b638a486abce5071aaf5;hpb=c7e61475680fa226bd9b8bdd469cd66914e630f5;p=debian%2Fgzip diff --git a/lib/open.c b/lib/open.c index 8027b47..f612b80 100644 --- a/lib/open.c +++ b/lib/open.c @@ -1,5 +1,5 @@ /* Open a descriptor to a file. - Copyright (C) 2007-2009 Free Software Foundation, Inc. + Copyright (C) 2007-2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -57,7 +57,7 @@ open (const char *filename, int flags, ...) va_start (arg, flags); /* We have to use PROMOTED_MODE_T instead of mode_t, otherwise GCC 4 - creates crashing code when 'mode_t' is smaller than 'int'. */ + creates crashing code when 'mode_t' is smaller than 'int'. */ mode = va_arg (arg, PROMOTED_MODE_T); va_end (arg); @@ -94,10 +94,10 @@ open (const char *filename, int flags, ...) { size_t len = strlen (filename); if (len > 0 && filename[len - 1] == '/') - { - errno = EISDIR; - return -1; - } + { + errno = EISDIR; + return -1; + } } #endif @@ -144,16 +144,16 @@ open (const char *filename, int flags, ...) /* We know len is positive, since open did not fail with ENOENT. */ size_t len = strlen (filename); if (filename[len - 1] == '/') - { - struct stat statbuf; - - if (fstat (fd, &statbuf) >= 0 && !S_ISDIR (statbuf.st_mode)) - { - close (fd); - errno = ENOTDIR; - return -1; - } - } + { + struct stat statbuf; + + if (fstat (fd, &statbuf) >= 0 && !S_ISDIR (statbuf.st_mode)) + { + close (fd); + errno = ENOTDIR; + return -1; + } + } } #endif