From d82802841cb7b86dfcf4efc90900fbeff4459fd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 26 Nov 2009 16:33:03 +0000 Subject: [PATCH] * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34290 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/libroot/posix/dirent.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/system/libroot/posix/dirent.c b/src/system/libroot/posix/dirent.c index 4e05af6768..c3e54155a5 100644 --- a/src/system/libroot/posix/dirent.c +++ b/src/system/libroot/posix/dirent.c @@ -1,6 +1,6 @@ /* * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. - * Copyright 2004-2008, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2004-2009, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. */ @@ -100,10 +100,10 @@ do_seek_dir(DIR* dir) DIR* __create_dir_struct(int fd) { - DIR* dir; - /* allocate the memory for the DIR structure */ - if ((dir = (DIR*)malloc(DIR_BUFFER_SIZE)) == NULL) { + + DIR* dir = (DIR*)malloc(DIR_BUFFER_SIZE); + if (dir == NULL) { errno = B_NO_MEMORY; return NULL; } @@ -117,7 +117,6 @@ __create_dir_struct(int fd) } - // #pragma mark - public API