summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Fontaine <arnau@debian.org>2011-12-14 19:09:16 +0900
committerArnaud Fontaine <arnau@debian.org>2011-12-14 20:08:58 +0900
commit7fe1a565a902798a8d69ea0c3f2c8c2e7055189c (patch)
tree087f7775f729b1920cd79641058c192e474d0253
parent55597dda964d335e5f63892c1b37c36b90eeffb4 (diff)
Close property the Display and fix error exit code value.
-rw-r--r--transSet.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/transSet.c b/transSet.c
index a59bd38..2b4b75b 100644
--- a/transSet.c
+++ b/transSet.c
@@ -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;
}