From 5e1a84ab74d5e97582427f016f291a8c11e66f99 Mon Sep 17 00:00:00 2001 From: jutteau Date: Fri, 11 May 2007 18:10:19 +0000 Subject: Completion du script de mise à jour de la pc-104 : * Ajout des sources de busybox dans ./conf/busybox/ * Ajout d'un fichier réclamé par les script dans ./conf/busybox.links --- i/pc104/initrd/conf/busybox/libbb/isdirectory.c | 39 +++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 i/pc104/initrd/conf/busybox/libbb/isdirectory.c (limited to 'i/pc104/initrd/conf/busybox/libbb/isdirectory.c') diff --git a/i/pc104/initrd/conf/busybox/libbb/isdirectory.c b/i/pc104/initrd/conf/busybox/libbb/isdirectory.c new file mode 100644 index 0000000..b359198 --- /dev/null +++ b/i/pc104/initrd/conf/busybox/libbb/isdirectory.c @@ -0,0 +1,39 @@ +/* vi: set sw=4 ts=4: */ +/* + * Utility routines. + * + * Based in part on code from sash, Copyright (c) 1999 by David I. Bell + * Permission has been granted to redistribute this code under the GPL. + * + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. + */ + +#include +#include "libbb.h" + +/* + * Return TRUE if a fileName is a directory. + * Nonexistent files return FALSE. + */ +int is_directory(const char *fileName, const int followLinks, struct stat *statBuf) +{ + int status; + struct stat astatBuf; + + if (statBuf == NULL) { + /* set from auto stack buffer */ + statBuf = &astatBuf; + } + + if (followLinks) + status = stat(fileName, statBuf); + else + status = lstat(fileName, statBuf); + + if (status < 0 || !(S_ISDIR(statBuf->st_mode))) { + status = FALSE; + } + else status = TRUE; + + return status; +} -- cgit v1.2.3