git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Version 1.11.10.
[libguestfs.git]
/
src
/
guestfs.c
diff --git
a/src/guestfs.c
b/src/guestfs.c
index
206841e
..
b02bdb9
100644
(file)
--- a/
src/guestfs.c
+++ b/
src/guestfs.c
@@
-1,5
+1,5
@@
/* libguestfs
/* libguestfs
- * Copyright (C) 2009-201
0
Red Hat Inc.
+ * Copyright (C) 2009-201
1
Red Hat Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@
-169,16
+169,19
@@
guestfs_create (void)
void
guestfs_close (guestfs_h *g)
{
void
guestfs_close (guestfs_h *g)
{
- int i;
- char filename[256];
- guestfs_h *gg;
-
if (g->state == NO_HANDLE) {
/* Not safe to call ANY callbacks here, so ... */
fprintf (stderr, _("guestfs_close: called twice on the same handle\n"));
return;
}
if (g->state == NO_HANDLE) {
/* Not safe to call ANY callbacks here, so ... */
fprintf (stderr, _("guestfs_close: called twice on the same handle\n"));
return;
}
+ if (g->trace) {
+ const char trace_msg[] = "close";
+
+ guestfs___call_callbacks_message (g, GUESTFS_EVENT_TRACE,
+ trace_msg, strlen (trace_msg));
+ }
+
debug (g, "closing guestfs handle %p (state %d)", g, g->state);
/* Try to sync if autosync flag is set. */
debug (g, "closing guestfs handle %p (state %d)", g, g->state);
/* Try to sync if autosync flag is set. */
@@
-220,6
+223,8
@@
guestfs_close (guestfs_h *g)
remove_tmpdir (g);
if (g->cmdline) {
remove_tmpdir (g);
if (g->cmdline) {
+ size_t i;
+
for (i = 0; i < g->cmdline_size; ++i)
free (g->cmdline[i]);
free (g->cmdline);
for (i = 0; i < g->cmdline_size; ++i)
free (g->cmdline[i]);
free (g->cmdline);
@@
-232,6
+237,8
@@
guestfs_close (guestfs_h *g)
if (handles == g)
handles = g->next;
else {
if (handles == g)
handles = g->next;
else {
+ guestfs_h *gg;
+
for (gg = handles; gg->next != g; gg = gg->next)
;
gg->next = g->next;
for (gg = handles; gg->next != g; gg = gg->next)
;
gg->next = g->next;