From 4839c29cd15db05079dd28b04c4bf7476e9e9757 Mon Sep 17 00:00:00 2001 From: Eygene Ryabinkin Date: Sun, 25 Sep 2011 07:24:25 +0000 Subject: sysutils/fcron: fixup default argument promotion When mode_t is char- or short-like, it will be promoted to the pure int when it is passed as the variable argument [1], so we should pass 'int' to the va_arg. I had also eliminated fflush for the stream opened read-only, since it will always fail and there is no need to flush read-only streams. [1] http://c-faq.com/~scs/cclass/int/sx11c.html Feature safe: yes PR: 152304 --- sysutils/fcron/files/patch-fileconf.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 sysutils/fcron/files/patch-fileconf.c (limited to 'sysutils/fcron/files/patch-fileconf.c') diff --git a/sysutils/fcron/files/patch-fileconf.c b/sysutils/fcron/files/patch-fileconf.c new file mode 100644 index 000000000000..9255b7909027 --- /dev/null +++ b/sysutils/fcron/files/patch-fileconf.c @@ -0,0 +1,15 @@ +We don't need to fflush the file, since it is opened read-only. + +--- fileconf.c.orig 2011-07-18 19:55:28.726082293 +0400 ++++ fileconf.c 2011-07-18 19:55:37.988079816 +0400 +@@ -264,10 +264,6 @@ + cf->cf_next = file_base; + file_base = cf; + +- /* don't close as underlying fd may still be used by calling function */ +- if (fflush(file) != 0) +- error_e("could not fflush() file_name"); +- + free(default_line.cl_runas); + free(default_line.cl_mailto); + free(default_line.cl_tz); -- cgit v1.2.3