search for: guestfs___first_line_of_fil

Displaying 6 results from an estimated 6 matches for "guestfs___first_line_of_fil".

2013 Jan 24
2
[PATCH 1/2] lib: Add CLEANUP_FREE macro which automatically calls 'free' when leaving scope.
From: "Richard W.M. Jones" <rjones@redhat.com> Use the macro like this to create temporary variables which are automatically cleaned up when the scope is exited: { CLEANUP_FREE (char *, foo, strdup (bar)); /* char *foo = strdup (bar) */ ... // no need to call free (foo)! } On GCC and LLVM, this is implemented using __attribute__((cleanup(...))). On other
2014 Dec 02
0
[PATCH 2/5] inspect_os: Add support for detecting OpenBSD
...The currently mounted device may be a Hurd root. Hurd has distros * just like Linux. */ @@ -821,6 +873,18 @@ check_hostname_unix (guestfs_h *g, struct inspect_fs *fs) } break; + case OS_TYPE_OPENBSD: + if (guestfs_is_file (g, "/etc/myname")) { + fs->hostname = guestfs___first_line_of_file (g, "/etc/myname"); + if (fs->hostname == NULL) + return -1; + if (STREQ (fs->hostname, "")) { + free (fs->hostname); + fs->hostname = NULL; + } + } + break; + case OS_TYPE_MINIX: if (guestfs_is_file (g, "/etc/h...
2014 Dec 03
1
[PATCH 1/4] inspect_os: Add support for detecting OpenBSD
...The currently mounted device may be a Hurd root. Hurd has distros * just like Linux. */ @@ -821,6 +873,18 @@ check_hostname_unix (guestfs_h *g, struct inspect_fs *fs) } break; + case OS_TYPE_OPENBSD: + if (guestfs_is_file (g, "/etc/myname")) { + fs->hostname = guestfs___first_line_of_file (g, "/etc/myname"); + if (fs->hostname == NULL) + return -1; + if (STREQ (fs->hostname, "")) { + free (fs->hostname); + fs->hostname = NULL; + } + } + break; + case OS_TYPE_MINIX: if (guestfs_is_file (g, "/etc/h...
2013 Jan 25
4
[PATCH 0/3] Use __attribute__((cleanup(...)))
This patch series changes a small part of the library to use __attribute__((cleanup(...))) to automatically free memory when pointers go out of the current scope. In general terms this seems to be a small win although you do have to use it carefully. For functions where you can completely get rid of the "exit code paths", it can simplify things. For a good example, see the
2014 Sep 22
1
[PATCH] inspect: basic Minix support
...eturn 0; +} + static void check_architecture (guestfs_h *g, struct inspect_fs *fs) { @@ -863,6 +908,18 @@ check_hostname_unix (guestfs_h *g, struct inspect_fs *fs) } break; + case OS_TYPE_MINIX: + if (guestfs_is_file (g, "/etc/hostname.file")) { + fs->hostname = guestfs___first_line_of_file (g, "/etc/hostname.file"); + if (fs->hostname == NULL) + return -1; + if (STREQ (fs->hostname, "")) { + free (fs->hostname); + fs->hostname = NULL; + } + } + break; + case OS_TYPE_WINDOWS: /* not here, see check_windows_s...
2015 Feb 14
2
[PATCH 0/2] Change guestfs__*
libguestfs has used double and triple underscores in identifiers. These aren't valid for global names in C++. (http://stackoverflow.com/a/228797) These large but completely mechanical patches change the illegal identifiers to legal ones. Rich.