X-Git-Url: http://git.tuebingen.mpg.de/?p=osl.git;a=blobdiff_plain;f=util.h;h=f8925113935bd9fa1de877d24df37ef0b12024d2;hp=53221c99e6ac7b9fc68cda57ef60b08b4bd28206;hb=HEAD;hpb=e2950383a28766d521a69ec5660b8271f322cbdb diff --git a/util.h b/util.h index 53221c9..f892511 100644 --- a/util.h +++ b/util.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2008 Andre Noll + * Copyright (C) 2006-2009 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -26,7 +26,7 @@ static inline int osl_mkdir(const char *path, mode_t mode) { if (!mkdir(path, mode)) return 1; - return -E_OSL_MKDIR; + return errno == EEXIST? -E_OSL_DIR_EXISTS : -E_OSL_MKDIR; } /** @@ -50,5 +50,5 @@ _static_inline_ int osl_stat(const char *path, struct stat *buf) { if (stat(path, buf) >= 0) return 1; - return -E_OSL_STAT; + return errno == ENOENT? -E_OSL_NOENT : -E_OSL_STAT; }