Replace '1' with "EXIT_FAILURE"
Patch status: merged
Patch by TheKK
To apply this patch, use:
curl http://cr.i3wm.org/patch/473/raw.patch | git am
b/i3lock.c
13 |
@@ -664,7 +664,7 @@ int main(int argc, char *argv[]) { |
14 |
}; |
15 |
|
16 |
if ((username = getenv("USER")) == NULL) |
17 |
- errx(1, "USER environment variable not set, please set it.\n"); |
18 |
+ errx(EXIT_FAILURE, "USER environment variable not set, please set it.\n"); |
19 |
|
20 |
while ((o = getopt_long(argc, argv, "hvnbdc:p:ui:te", longopts, &optind)) != -1) { |
21 |
switch (o) { |
22 |
@@ -687,7 +687,7 @@ int main(int argc, char *argv[]) { |
23 |
arg++; |
24 |
|
25 |
if (strlen(arg) != 6 || sscanf(arg, "%06[0-9a-fA-F]", color) != 1) |
26 |
- errx(1, "color is invalid, it must be given in 3-byte hexadecimal format: rrggbb\n"); |
27 |
+ errx(EXIT_FAILURE, "color is invalid, it must be given in 3-byte hexadecimal format: rrggbb\n"); |
28 |
|
29 |
break; |
30 |
} |
31 |
@@ -706,7 +706,7 @@ int main(int argc, char *argv[]) { |
32 |
} else if (!strcmp(optarg, "default")) { |
33 |
curs_choice = CURS_DEFAULT; |
34 |
} else { |
35 |
- errx(1, "i3lock: Invalid pointer type given. Expected one of \"win\" or \"default\".\n"); |
36 |
+ errx(EXIT_FAILURE, "i3lock: Invalid pointer type given. Expected one of \"win\" or \"default\".\n"); |
37 |
} |
38 |
break; |
39 |
case 'e': |
40 |
@@ -717,7 +717,7 @@ int main(int argc, char *argv[]) { |
41 |
debug_mode = true; |
42 |
break; |
43 |
default: |
44 |
- errx(1, "Syntax: i3lock [-v] [-n] [-b] [-d] [-c color] [-u] [-p win|default]" |
45 |
+ errx(EXIT_FAILURE, "Syntax: i3lock [-v] [-n] [-b] [-d] [-c color] [-u] [-p win|default]" |
46 |
" [-i image.png] [-t] [-e]" |
47 |
); |
48 |
} |