w3m: Avoid depending on libgc-dev when building
[termux-packages] / packages / mc / fix-small-mode-t.patch
CommitLineData
b4dab8e7
FF
1Following compiler warning:
2
3/home/fornwall/termux/mc/src/lib/vfs/interface.c: In function 'mc_open':
4/home/fornwall/termux/mc/src/lib/vfs/interface.c:203:28: warning: 'mode_t' is promoted to 'int' when passed through '...'
5 mode = va_arg (ap, mode_t);
6 ^
7/home/fornwall/termux/mc/src/lib/vfs/interface.c:203:28: note: (so you should pass 'int' not 'mode_t' to 'va_arg')
8/home/fornwall/termux/mc/src/lib/vfs/interface.c:203:28: note: if this code is reached, the program will abort
9
10which causes crash on arm devices due to mode_t being unsigned int.
11
12diff -u -r ../mc-4.8.16/lib/vfs/interface.c ./lib/vfs/interface.c
13--- ../mc-4.8.16/lib/vfs/interface.c 2016-03-12 10:45:47.000000000 -0500
14+++ ./lib/vfs/interface.c 2016-03-14 22:03:41.417524612 -0400
15@@ -200,7 +200,7 @@
16 {
17 va_list ap;
18 va_start (ap, flags);
19- mode = va_arg (ap, mode_t);
20+ mode = (mode_t) va_arg (ap, unsigned int);
21 va_end (ap);
22 }
23
24diff -u -r ../mc-4.8.16/src/editor/editcmd.c ./src/editor/editcmd.c
25--- ../mc-4.8.16/src/editor/editcmd.c 2016-03-12 10:45:47.000000000 -0500
26+++ ./src/editor/editcmd.c 2016-03-14 22:03:02.094128021 -0400
27@@ -301,7 +301,7 @@
28 (void) mc_chown (savename_vpath, edit->stat1.st_uid, edit->stat1.st_gid);
29 (void) mc_chmod (savename_vpath, edit->stat1.st_mode);
30
31- fd = mc_open (savename_vpath, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, edit->stat1.st_mode);
32+ fd = mc_open (savename_vpath, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, (unsigned int) edit->stat1.st_mode);
33 if (fd == -1)
34 goto error_save;
35