1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
--- emacs-18.59-orig/src/ChangeLog
+++ emacs-18.59/src/ChangeLog
@@ -1,3 +1,11 @@
+2015-12-19 Ulrich Mueller <ulm@gentoo.org>
+
+ Fix a couple of compiler warnings.
+ * buffer.c (init_buffer): Use getcwd(3) instead of getwd(3).
+ * callproc.c (Fcall_process): Check for errors of pipe(2).
+ (child_setup): Check for errors of chdir(2).
+ * process.c (sigchld_handler): Add type cast.
+
2012-06-28 Ulrich Mueller <ulm@gentoo.org>
Support x32 ABI on x86_64 architecture.
--- emacs-18.59-orig/src/buffer.c
+++ emacs-18.59/src/buffer.c
@@ -1131,8 +1131,8 @@
char buf[MAXPATHLEN+1];
Fset_buffer (Fget_buffer_create (build_string ("*scratch*")));
- if (getwd (buf) == 0)
- fatal ("`getwd' failed: %s.\n", buf);
+ if (getcwd (buf, MAXPATHLEN+1) == 0)
+ fatal ("`getcwd' failed: %s.\n", buf);
#ifndef VMS
/* Maybe this should really use some standard subroutine
--- emacs-18.59-orig/src/callproc.c
+++ emacs-18.59/src/callproc.c
@@ -184,7 +184,10 @@
#endif /* not VMS */
else
{
- pipe (fd);
+ if (pipe (fd) < 0) {
+ close (filefd);
+ report_file_error ("Creating pipe", Qnil);
+ }
#if 0
/* Replaced by close_process_descs */
set_exclusive_use (fd[0]);
@@ -362,7 +365,8 @@
bcopy (XSTRING (current_buffer->directory)->data, temp, i);
if (temp[i - 1] != '/') temp[i++] = '/';
temp[i] = 0;
- chdir (temp);
+ if (chdir (temp) < 0)
+ _exit (1);
}
#ifndef MAINTAIN_ENVIRONMENT
--- emacs-18.59-orig/src/process.c
+++ emacs-18.59/src/process.c
@@ -2517,7 +2517,7 @@
if (WIFEXITED (w))
synch_process_retcode = WRETCODE (w);
else if (WIFSIGNALED (w))
- synch_process_death = sys_siglist[WTERMSIG (w)];
+ synch_process_death = (char *) sys_siglist[WTERMSIG (w)];
}
/* On some systems, we must return right away.
--- emacs-18.59-orig/etc/ChangeLog
+++ emacs-18.59/etc/ChangeLog
@@ -1,3 +1,7 @@
+2015-12-19 Ulrich Mueller <ulm@gentoo.org>
+
+ * etags.c (main): Check for errors of system(3).
+
2012-06-28 Ulrich Mueller <ulm@gentoo.org>
* fakemail.c (make_file_preface): time(2) returns a value of
--- emacs-18.59-orig/etc/etags.c
+++ emacs-18.59/etc/etags.c
@@ -342,7 +342,8 @@
sprintf(cmd,
"mv %s OTAGS;fgrep -v '\t%s\t' OTAGS >%s;rm OTAGS",
outfile, av[i], outfile);
- system(cmd);
+ if (system(cmd) != 0)
+ fatal ("%s", "failed to execute shell command");
}
aflag++;
}
@@ -359,7 +360,8 @@
if (uflag)
{
sprintf(cmd, "sort %s -o %s", outfile, outfile);
- system(cmd);
+ if (system(cmd) != 0)
+ fatal ("%s", "failed to execute shell command");
}
#endif
exit(GOOD);
|