* GNU General Public License for more details.
*/
+#define _GNU_SOURCE
#include <libubox/avl.h>
#include <libubox/avl-cmp.h>
#include "utils.h"
#include "../log.h"
+#ifndef O_PATH
+#define O_PATH 010000000
+#endif
+
void
__blobmsg_list_init(struct blobmsg_list *list, int offset, int len, blobmsg_list_cmp cmp)
{
device = "/dev/null";
if (*device != '/') {
- dfd = open("/dev", O_RDONLY);
+ dfd = open("/dev", O_PATH|O_DIRECTORY);
if (dfd < 0)
return -1;