search for: closedir

Displaying 20 results from an estimated 281 matches for "closedir".

2009 Aug 03
1
[PATCH] Recognise cd-rom devices in devsparts.c
...media. - */ - int fd = open (buf, O_RDONLY); - if (fd == -1) { - perror (buf); - continue; + if (add_string (&r, &size, &alloc, dev_path) == -1) { + return 0; } - close (fd); - if (add_string (&r, &size, &alloc, buf) == -1) { - closedir (dir); - return NULL; - } - } + return 1; } - if (add_string (&r, &size, &alloc, NULL) == -1) { - closedir (dir); - return NULL; - } + if(!foreach_block_device(add_to_device_list)) return NULL; - if (closedir (dir) == -1) { - reply_with_perror ("clo...
2009 Feb 17
5
Problems in Compiling MFC
1) i'm facing problem while compiling MFC code when "winemaker" command is given i get these lines admin at XXX:~/.wine/drive_c/windows/system32/MFC> winemaker --lower-uppercase . Winemaker 0.6.0 Copyright 2000 Francois Gouget <fgouget at codeweavers.com> for CodeWeavers closedir() attempted on invalid dirhandle DIRECTORY at /usr/local/bin/winemaker line 1054. closedir() attempted on invalid dirhandle DIRECTORY at /usr/local/bin/winemaker line 1054. Scanning the source directories... closedir() attempted on invalid dirhandle DIRECTORY at /usr/local/bin/winemaker line 607. c...
2016 Jul 07
0
[PATCH 2/2] daemon: fix cleanup of stringsbuf usages
...return NULL; - return r.argv; + return take_stringsbuf (&r); } while (1) { @@ -93,7 +93,6 @@ do_list_9p (void) /* Check readdir didn't fail */ if (errno != 0) { reply_with_perror ("readdir: /sys/block"); - free_stringslen (r.argv, r.size); closedir (dir); return NULL; } @@ -101,7 +100,6 @@ do_list_9p (void) /* Close the directory handle */ if (closedir (dir) == -1) { reply_with_perror ("closedir: /sys/block"); - free_stringslen (r.argv, r.size); return NULL; } @@ -113,7 +111,7 @@ do_list_9p (void)...
2009 Feb 11
1
[PATCH 1/1] COM32 API: Add functions for directory use
From: Gene Cumm <gene.cumm at gmail.com> COM32: Add directory functions getcwd(), opendir(), readdir() and closedir(). This depends on the patch that I just submitted creating the COMBOOT API calls. Signed-off-by: Gene Cumm <gene.cumm at gmail.com> --- The intention is to create the library calls with (hopefully) POSIX compliance such that a small application written to use these 4 POSIX calls will wor...
2008 Dec 04
0
[PATCH 1/1] COM32: Add directory functions
From: Gene Cumm <gene.cumm at gmail.com> COM32: Add directory functions getcwd(), opendir(), readdir() and closedir(). This depends on the patch that I just submitted creating the COMBOOT API calls. Signed-off-by: Gene Cumm <gene.cumm at gmail.com> --- The intention is to create the library calls with (hopefully) POSIX compliance such that a small application written to use these 4 POSIX calls will wor...
2016 Jul 07
2
[PATCH 1/2] daemon: free the string on stringsbuf add failure
...(rawdev); goto error; + } if (add_string_nodup (&ret, rawdev) == -1) goto error; - rawdev = NULL; /* buffer now owned by the stringsbuf */ } /* Check readdir didn't fail */ @@ -380,6 +381,5 @@ do_list_disk_labels (void) error: if (dir) closedir (dir); - free (rawdev); return NULL; } diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c index 8b9acc7..af151bd 100644 --- a/daemon/guestfsd.c +++ b/daemon/guestfsd.c @@ -512,6 +512,7 @@ add_string_nodup (struct stringsbuf *sb, char *str) reply_with_perror ("realloc");...
2016 Jul 25
2
[PATCH] osinfo: revamp db reading (RHBZ#1359652)
...,7 @@ read_osinfo_db (guestfs_h *g) /* Check for failure in readdir. */ if (errno != 0) { - perrorf (g, "readdir: %s", LIBOSINFO_DB_OS_PATH); + perrorf (g, "readdir: %s", directory); goto error; } @@ -193,26 +267,67 @@ read_osinfo_db (guestfs_h *g) r = closedir (dir); dir = NULL; if (r == -1) { - perrorf (g, "closedir: %s", LIBOSINFO_DB_OS_PATH); + perrorf (g, "closedir: %s", directory); goto error; } - return 0; + return 1; error: if (dir) closedir (dir); - /* Fatal error: free any database entri...
2012 Jan 24
14
[PATCH 00/14] Run the daemon under valgrind and fix resultant errors.
This patch series lets you run the daemon under valgrind. Many errors were found and fixed. With the complete series applied, valgrind doesn't show any errors.
2011 Jan 03
1
[PATCH] COM32R documentation: fix typo 'pm_cs'
...*pm_cs->opendir(const char *pathname) +DIR *cs_pm->opendir(const char *pathname) Open a directory. -struct dirent *pm_cs->readdir(DIR *dir) +struct dirent *cs_pm->readdir(DIR *dir) Read an entry from a directory. The entry is returned in a static buffer. -int pm_cs->closedir(DIR *dir) +int cs_pm->closedir(DIR *dir) Close a directory. -- 1.7.3.4
2017 Feb 14
0
[PATCH 2/2] GCC 7: Allocate sufficient space for sprintf output.
...g_path, - BUS_PATH "/%s/mount_tag", d->d_name); + CLEANUP_FREE char *mount_tag_path; + if (asprintf (&mount_tag_path, BUS_PATH "/%s/mount_tag", + d->d_name) == -1) { + reply_with_perror ("asprintf"); + closedir (dir); + return NULL; + } /* A bit unclear, but it looks like the virtio transport allows * the mount tag length to be unlimited (or up to 65536 bytes). diff --git a/daemon/debug.c b/daemon/debug.c index 06f0729..b18d87c 100644 --- a/daemon/debug.c +++ b/daemon/debug.c...
2017 Feb 14
0
[PATCH v2 2/2] GCC 7: Allocate sufficient space for sprintf output.
...g_path, - BUS_PATH "/%s/mount_tag", d->d_name); + CLEANUP_FREE char *mount_tag_path; + if (asprintf (&mount_tag_path, BUS_PATH "/%s/mount_tag", + d->d_name) == -1) { + reply_with_perror ("asprintf"); + closedir (dir); + return NULL; + } /* A bit unclear, but it looks like the virtio transport allows * the mount tag length to be unlimited (or up to 65536 bytes). diff --git a/daemon/debug.c b/daemon/debug.c index 06f0729..b18d87c 100644 --- a/daemon/debug.c +++ b/daemon/debug.c...
2017 Sep 13
4
sanitizer test case failures after OS update
I updated one of my powerpc64le llvm test systems to Fedora 25 and I started getting a whole bunch of sanitizer test case failures. I tried testing some earlier revisions on the new OS that had worked fine under the old but they generate the same errors now so it isn't any changes in llvm. There are two different errors: FATAL: ThreadSanitizer: unsupported VMA range FATAL: Found 47 -
2017 Jul 14
0
[PATCH 05/27] daemon: Reimplement several devsparts APIs in OCaml.
...return_md && - STREQLEN (d->d_name, "md", 2) && c_isdigit (d->d_name[2]))) { - CLEANUP_FREE char *dev_path = NULL; - if (asprintf (&dev_path, "/dev/%s", d->d_name) == -1) { - reply_with_perror ("asprintf"); - closedir (dir); - return NULL; - } - - /* Ignore the root device. */ - if (is_root_device (dev_path)) - continue; - - /* RHBZ#514505: Some versions of qemu <= 0.10 add a - * CD-ROM device even though we didn't request it. Try to - * detect this by seeing...
2001 Aug 13
1
[PATCH] Maildir support
...dir(dirname); + + snprintf(dirname, pathlen, "%s/cur", mailbox); + curdir = opendir(dirname); + free(dirname); + + if (newdir && curdir) { + long newmail = -2; + long curmail = -2; + char buf[64]; + + while (readdir(newdir)) + newmail++; + closedir(newdir); + while (readdir(curdir)) + curmail++; + closedir(curdir); + + if (curmail > 0 || newmail > 0) { + sprintf(buf, "You have "); + if (newmail > 0) { + sprintf(buf + strlen(buf), "%ld new mail%s", + newmail, (newmail > 1) ? "s&q...
2014 Nov 23
0
[PATCH 3/3] New APIs: bmap-file, bmap-device, bmap.
...ot; +#include "actions.h" + +static int fd = -1; +static DIR *dir = NULL; +static struct stat statbuf; + +static void bmap_finalize (void) __attribute__((destructor)); +static void +bmap_finalize (void) +{ + if (fd >= 0) { + close (fd); + fd = -1; + } + if (dir != NULL) { + closedir (dir); + dir = NULL; + } +} + +static int +bmap_prepare (const char *path, const char *orig_path) +{ + bmap_finalize (); + + if (stat (path, &statbuf) == -1) { + reply_with_perror ("%s", orig_path); + return -1; + } + + if (S_ISDIR (statbuf.st_mode)) { + /* Open a dir...
2012 Mar 13
2
[PATCH 0/2] 'int' to 'size_t' changes
These two patches are probably not completely independent, but separating them is a lot of work. With *both* patches applied, all the tests and extra-tests pass. That's no guarantee however that there isn't a mistake, so I don't think this patch is a candidate for the 1.16 branch, until it's had a lot more testing in development. Rich.
2008 Sep 19
2
Bug in keywords conversion with courier-dovecot-migrate.pl v1.1.7
The problem is the file glob on line 344 in convert_subscriptions() # read updates from the directory my %updates; foreach (<$keyword_dir/*>) { This isn't going to pick up any files beginning with a dot, so most of the update files in the courierimapkeywords directory are going to be skipped.
2010 Dec 02
0
samba3x troubles
...donly: domain_socket = False scannedonly: portnum = 2020 scannedonly: scanhost = localhost scannedonly: hide_nonscanned_files = False scannedonly: allow_nonscanned_files = True full_audit:prefix = %u|%I full_audit:failure = none full_audit:success = connect disconnect opendir mkdir rmdir closedir open close read pread write pwrite sendfile rename unlink chmod fchmod chown fchown chdir ftruncate lock symlink readlink link mknod realpath full_audit:facility = local5 full_audit:priority = notice [production] comment = prod path = /var/share/production read only = No guest ok = no val...
2003 Aug 24
1
readdir() and read() errors ignored
...return -1; } - for (di=readdir(d); di; di=readdir(d)) { + for (errno = 0, di=readdir(d); di; errno = 0, di=readdir(d)) { char *dname = d_name(di); if (strcmp(dname,".")==0 || strcmp(dname,"..")==0) @@ -99,6 +99,12 @@ return -1; } } + if ( errno ) { + closedir(d); + rprintf(FERROR,"delete_file: readdir(%s): %s\n", + fname,strerror(errno)); + return -1; + } closedir(d);
2014 Nov 23
7
[PATCH 0/3] patches needed for virt-bmap
See http://rwmj.wordpress.com/2014/11/23/mapping-files-to-disk/