summaryrefslogtreecommitdiffstats
path: root/gl/open-safer.c
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <dermoth@aei.ca>2010-04-07 21:11:46 -0400
committerThomas Guyot-Sionnest <dermoth@aei.ca>2010-04-12 21:26:35 -0400
commit74da141e618ef99959d509cb2e7be35a348a39db (patch)
tree88ebc38b381a1021fc2d74864a71e230ae591c3d /gl/open-safer.c
parentc63a4f726a0b6ad8cf6040f947754a81fd4683bb (diff)
downloadmonitoring-plugins-74da141e618ef99959d509cb2e7be35a348a39db.tar.gz
Sync with the latest Gnulib code (177f525)
Signed-off-by: Thomas Guyot-Sionnest <dermoth@aei.ca>
Diffstat (limited to 'gl/open-safer.c')
-rw-r--r--gl/open-safer.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/gl/open-safer.c b/gl/open-safer.c
index 15bf6a65..3b36471f 100644
--- a/gl/open-safer.c
+++ b/gl/open-safer.c
@@ -1,6 +1,6 @@
1/* Invoke open, but avoid some glitches. 1/* Invoke open, but avoid some glitches.
2 2
3 Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc. 3 Copyright (C) 2005-2006, 2008-2010 Free Software Foundation, Inc.
4 4
5 This program is free software: you can redistribute it and/or modify 5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
@@ -35,13 +35,9 @@ open_safer (char const *file, int flags, ...)
35 va_list ap; 35 va_list ap;
36 va_start (ap, flags); 36 va_start (ap, flags);
37 37
38 /* Assume mode_t promotes to int if and only if it is smaller. 38 /* We have to use PROMOTED_MODE_T instead of mode_t, otherwise GCC 4
39 This assumption isn't guaranteed by the C standard, but we 39 creates crashing code when 'mode_t' is smaller than 'int'. */
40 don't know of any real-world counterexamples. */ 40 mode = va_arg (ap, PROMOTED_MODE_T);
41 if (sizeof (mode_t) < sizeof (int))
42 mode = va_arg (ap, int);
43 else
44 mode = va_arg (ap, mode_t);
45 41
46 va_end (ap); 42 va_end (ap);
47 } 43 }