diff options
author | Arnaud Fontaine <arnau@debian.org> | 2011-12-14 19:09:16 +0900 |
---|---|---|
committer | Arnaud Fontaine <arnau@debian.org> | 2011-12-14 20:08:58 +0900 |
commit | 7fe1a565a902798a8d69ea0c3f2c8c2e7055189c (patch) | |
tree | 087f7775f729b1920cd79641058c192e474d0253 | |
parent | 55597dda964d335e5f63892c1b37c36b90eeffb4 (diff) |
Close property the Display and fix error exit code value.
-rw-r--r-- | transSet.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -225,7 +225,8 @@ main (int argc, char **argv) sscanf (idstr, "%ld", &target_win); if (!target_win) { fprintf (stderr, "Invalid window id format: %s.\n", idstr); - exit (0); + XCloseDisplay (dpy); + return 1; } if (flag_verbose) printf ("Selected 0x%x, trying to get top parent ... ", @@ -248,7 +249,8 @@ main (int argc, char **argv) if (!target_win) { fprintf (stderr, "No window matching %s exists!\n", namestr); - exit (0); + XCloseDisplay (dpy); + return 1; } /* store the matched window name*/ XFetchName (dpy, target_win, &windowname); @@ -325,5 +327,6 @@ main (int argc, char **argv) if (flag_verbose) printf ("Propery set on: 0x%x\n", (unsigned int) target_win); + XCloseDisplay (dpy); return 0; } |