summaryrefslogtreecommitdiffstats
path: root/libc/stdio
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-09-05 23:25:38 +0200
committerAustin Foxley <austinf@cetoncorp.com>2009-09-18 11:23:05 -0700
commitff12bad5238a65fa2ff6f02468213947211a6362 (patch)
tree30c9e9b875b01899561945f4cee4b236123e3aec /libc/stdio
parent03dad084f4c6d0c16c779a3faa84dc039c3249e6 (diff)
downloaduClibc-alpine-ff12bad5238a65fa2ff6f02468213947211a6362.tar.bz2
uClibc-alpine-ff12bad5238a65fa2ff6f02468213947211a6362.tar.xz
remove(): slight readabability tweak, no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libc/stdio')
-rw-r--r--libc/stdio/remove.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libc/stdio/remove.c b/libc/stdio/remove.c
index c186164b8..af2850733 100644
--- a/libc/stdio/remove.c
+++ b/libc/stdio/remove.c
@@ -10,22 +10,19 @@
#include <unistd.h>
#include <errno.h>
-/* libc_hidden_proto(rmdir) */
-/* libc_hidden_proto(unlink) */
-
/* SUSv3 states:
* If path does not name a directory, remove(path) shall be equivalent
* to unlink(path). If path names a directory, remove(path) shall be
* equivalent to rmdir(path).
*/
-/* libc_hidden_proto(remove) */
int remove(register const char *filename)
{
int saved_errno = errno;
int rv;
- if (((rv = rmdir(filename)) < 0) && (errno == ENOTDIR)) {
+ rv = rmdir(filename);
+ if ((rv < 0) && (errno == ENOTDIR)) {
__set_errno(saved_errno); /* Need to restore errno. */
rv = unlink(filename);
}