summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2013-07-17 16:18:04 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-09-11 19:44:54 +0200
commit10a9ff0c9b4f347ec24dab887a538b37274ee498 (patch)
treefb69605e51d9367833fcc49d02dcb68f36fa0d52 /src
parentec0b19bd6d25e3f4afea06b28c132b602bbff180 (diff)
downloadsssd-10a9ff0c9b4f347ec24dab887a538b37274ee498.tar.gz
sssd-10a9ff0c9b4f347ec24dab887a538b37274ee498.tar.bz2
sssd-10a9ff0c9b4f347ec24dab887a538b37274ee498.zip
Fix formating of variables with type: rlim_t
Diffstat (limited to 'src')
-rw-r--r--src/responder/common/responder_common.c10
-rw-r--r--src/util/sss_format.h7
2 files changed, 12 insertions, 5 deletions
diff --git a/src/responder/common/responder_common.c b/src/responder/common/responder_common.c
index 58a92f97..908031a0 100644
--- a/src/responder/common/responder_common.c
+++ b/src/responder/common/responder_common.c
@@ -999,7 +999,7 @@ void responder_set_fd_limit(rlim_t fd_limit)
limret = setrlimit(RLIMIT_NOFILE, &new_limit);
if (limret == 0) {
DEBUG(SSSDBG_CONF_SETTINGS,
- ("Maximum file descriptors set to [%d]\n",
+ ("Maximum file descriptors set to [%"SPRIrlim"]\n",
new_limit.rlim_cur));
return;
}
@@ -1012,7 +1012,7 @@ void responder_set_fd_limit(rlim_t fd_limit)
limret = getrlimit(RLIMIT_NOFILE, &current_limit);
if (limret == 0) {
DEBUG(SSSDBG_TRACE_INTERNAL,
- ("Current fd limit: [%d]\n",
+ ("Current fd limit: [%"SPRIrlim"]\n",
current_limit.rlim_cur));
/* Choose the lesser of the requested and the hard limit */
if (current_limit.rlim_max < fd_limit) {
@@ -1025,12 +1025,12 @@ void responder_set_fd_limit(rlim_t fd_limit)
limret = setrlimit(RLIMIT_NOFILE, &new_limit);
if (limret == 0) {
DEBUG(SSSDBG_CONF_SETTINGS,
- ("Maximum file descriptors set to [%d]\n",
+ ("Maximum file descriptors set to [%"SPRIrlim"]\n",
new_limit.rlim_cur));
} else {
DEBUG(SSSDBG_CRIT_FAILURE,
- ("Could not set new fd limits. Proceeding with [%d]\n",
- current_limit.rlim_cur));
+ ("Could not set new fd limits. Proceeding with "
+ "[%"SPRIrlim"]\n", current_limit.rlim_cur));
}
} else {
DEBUG(SSSDBG_CRIT_FAILURE,
diff --git a/src/util/sss_format.h b/src/util/sss_format.h
index ac3d3828..a922ee36 100644
--- a/src/util/sss_format.h
+++ b/src/util/sss_format.h
@@ -32,4 +32,11 @@
/* key_serial_t is defined in keyutils.h as typedef int32_t */
#define SPRIkey_ser PRId32
+/* rlim_t is defined with conditional build as unsigned type.
+ * It seems that sizeof(rlim_t) is 8. It may be platform dependent, therefore
+ * the same format will be used like with uint64_t.
+ */
+
+#define SPRIrlim PRIu64
+
#endif /* __SSS_FORMAT_H__ */