summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2015-10-18 20:40:12 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2015-10-18 20:40:12 +0200
commitf28bc208ac98a9a05ff73f7c6c57262b33281d97 (patch)
tree01b64a1560110847b6b7ed658b4b53a2f369f6b8
parentc147d84219585cf25a53759cd2d73f435108be91 (diff)
downloadpgfuse-f28bc208ac98a9a05ff73f7c6c57262b33281d97.tar.gz
pgfuse-f28bc208ac98a9a05ff73f7c6c57262b33281d97.tar.bz2
fix around flag to string printf format
-rw-r--r--pgfuse.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/pgfuse.c b/pgfuse.c
index 5ae1078..e99fc7f 100644
--- a/pgfuse.c
+++ b/pgfuse.c
@@ -306,7 +306,18 @@ static char *flags_to_string( int flags )
s = (char *)malloc( 100 );
if( s == NULL ) return "<memory allocation failed>";
- snprintf( s, 100, "access_mode=%s, flags=%s%s%s%s%s%s%s",
+ snprintf( s, 100, "access_mode=%s, flags=%s%s%s%s"
+#ifdef O_NOFOLLOW
+"%s"
+#endif
+#ifdef O_CLOEXEC
+"%s"
+#endif
+#ifdef O_DIRECTORY
+"%s"
+#endif
+ "%s",
+ ( flags & O_EXCL ) ? "O_EXCL " : "",
mode_s,
( flags & O_CREAT ) ? "O_CREAT " : "",
( flags & O_TRUNC ) ? "O_TRUNC " : "",