blob: e284db0dbb9edbfc950226ca1f968eabf392c04d [file] [log] [blame]
Bernhard Reutner-Fischercb448162006-04-12 07:35:12 +00001/* vi: set sw=4 ts=4: */
2/*
3 * wrapper for opendir()
4 *
5 * Copyright (C) 2006 Bernhard Fischer <busybox@busybox.net>
6 *
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 */
9
10#include <sys/types.h>
11#include <dirent.h>
12#include "libbb.h"
13
14#ifdef L_bb_opendir
15DIR *bb_opendir(const char *path)
16{
17 DIR *dp;
18
19 if ((dp = opendir(path)) == NULL) {
20 bb_perror_msg("unable to open `%s'", path);
21 return NULL;
22 }
23 return dp;
24}
25#endif
26
27#ifdef L_bb_xopendir
28DIR *bb_xopendir(const char *path)
29{
30 DIR *dp;
31
32 if ((dp = opendir(path)) == NULL) {
33 bb_perror_msg_and_die("unable to open `%s'", path);
34 }
35 return dp;
36}
37#endif