aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEli Zaretskii2013-05-16 12:58:56 +0300
committerEli Zaretskii2013-05-16 12:58:56 +0300
commita9519e2685d19b13ce4e3e1ba13f97569013627e (patch)
tree6a9e0e35514c400749f23c891e9a95577fb9bfc1 /lib
parent3946d31b7bcf2a7dceacb86598823360f457cd19 (diff)
parent2d4bf34b5b83b3728b2fb18a72536f3e14afcf34 (diff)
downloademacs-a9519e2685d19b13ce4e3e1ba13f97569013627e.tar.gz
emacs-a9519e2685d19b13ce4e3e1ba13f97569013627e.zip
Merge from trunk.
Diffstat (limited to 'lib')
-rw-r--r--lib/sig2str.c12
-rw-r--r--lib/stdio.in.h14
2 files changed, 20 insertions, 6 deletions
diff --git a/lib/sig2str.c b/lib/sig2str.c
index 8b36e2facf0..6ead2a71d13 100644
--- a/lib/sig2str.c
+++ b/lib/sig2str.c
@@ -325,21 +325,25 @@ sig2str (int signum, char *signame)
325 { 325 {
326 int rtmin = SIGRTMIN; 326 int rtmin = SIGRTMIN;
327 int rtmax = SIGRTMAX; 327 int rtmax = SIGRTMAX;
328 int base, delta;
328 329
329 if (! (rtmin <= signum && signum <= rtmax)) 330 if (! (rtmin <= signum && signum <= rtmax))
330 return -1; 331 return -1;
331 332
332 if (signum <= rtmin + (rtmax - rtmin) / 2) 333 if (signum <= rtmin + (rtmax - rtmin) / 2)
333 { 334 {
334 int delta = signum - rtmin; 335 strcpy (signame, "RTMIN");
335 sprintf (signame, delta ? "RTMIN+%d" : "RTMIN", delta); 336 base = rtmin;
336 } 337 }
337 else 338 else
338 { 339 {
339 int delta = rtmax - signum; 340 strcpy (signame, "RTMAX");
340 sprintf (signame, delta ? "RTMAX-%d" : "RTMAX", delta); 341 base = rtmax;
341 } 342 }
342 343
344 delta = signum - base;
345 if (delta != 0)
346 sprintf (signame + 5, "%+d", delta);
343 return 0; 347 return 0;
344 } 348 }
345} 349}
diff --git a/lib/stdio.in.h b/lib/stdio.in.h
index d6af99ca77d..06cbad00d3d 100644
--- a/lib/stdio.in.h
+++ b/lib/stdio.in.h
@@ -579,13 +579,23 @@ _GL_CXXALIAS_SYS (fwrite, size_t,
579 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>, 579 <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>,
580 which sometimes causes an unwanted diagnostic for fwrite calls. 580 which sometimes causes an unwanted diagnostic for fwrite calls.
581 This affects only function declaration attributes under certain 581 This affects only function declaration attributes under certain
582 versions of gcc, and is not needed for C++. */ 582 versions of gcc and clang, and is not needed for C++. */
583# if (0 < __USE_FORTIFY_LEVEL \ 583# if (0 < __USE_FORTIFY_LEVEL \
584 && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \ 584 && __GLIBC__ == 2 && 4 <= __GLIBC_MINOR__ && __GLIBC_MINOR__ <= 15 \
585 && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \ 585 && 3 < __GNUC__ + (4 <= __GNUC_MINOR__) \
586 && !defined __cplusplus) 586 && !defined __cplusplus)
587# undef fwrite 587# undef fwrite
588# define fwrite(a, b, c, d) ({size_t __r = fwrite (a, b, c, d); __r; }) 588# undef fwrite_unlocked
589extern size_t __REDIRECT (rpl_fwrite,
590 (const void *__restrict, size_t, size_t,
591 FILE *__restrict),
592 fwrite);
593extern size_t __REDIRECT (rpl_fwrite_unlocked,
594 (const void *__restrict, size_t, size_t,
595 FILE *__restrict),
596 fwrite_unlocked);
597# define fwrite rpl_fwrite
598# define fwrite_unlocked rpl_fwrite_unlocked
589# endif 599# endif
590# endif 600# endif
591_GL_CXXALIASWARN (fwrite); 601_GL_CXXALIASWARN (fwrite);