Skip to content

Commit

Permalink
use gp_system_*dir functions instead of the bare readdir/opendir/clos…
Browse files Browse the repository at this point in the history
…edir

to help with gphoto#33
  • Loading branch information
msmeissn committed Jan 3, 2016
1 parent b2131c5 commit 29248df
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions libgphoto2_port/vusb/vcamera.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "config.h"
#include <gphoto2/gphoto2-port-library.h>
#include <gphoto2/gphoto2-port-portability.h>

#ifdef HAVE_LIBEXIF
# include <libexif/exif-data.h>
Expand Down Expand Up @@ -368,12 +369,12 @@ static uint32_t ptp_objectid = 0;
static void
read_directories(char *path, struct ptp_dirent *parent) {
struct ptp_dirent *cur;
DIR *dir;
struct dirent *de;
gp_system_dir dir;
gp_system_dirent de;

dir = opendir(path);
dir = gp_system_opendir(path);
if (!dir) return;
while ((de=readdir(dir))) {
while ((de=gp_system_readdir(dir))) {
if (!strcmp(de->d_name,".")) continue;
if (!strcmp(de->d_name,"..")) continue;

Expand All @@ -393,7 +394,7 @@ read_directories(char *path, struct ptp_dirent *parent) {
if (S_ISDIR(cur->stbuf.st_mode))
read_directories(cur->fsname, cur); /* recurse! */
}
closedir(dir);
gp_system_closedir(dir);
}

static void
Expand Down

0 comments on commit 29248df

Please sign in to comment.