log more info when setrlimit fail

pull/37/head
YuQing 2019-03-19 14:29:52 +08:00
parent e9822aa8e3
commit 91f707d1b4
1 changed files with 5 additions and 4 deletions

View File

@ -1457,10 +1457,11 @@ int set_rlimit(int resource, const rlim_t value)
break; break;
} }
logError("file: "__FILE__", line: %d, " \ logError("file: "__FILE__", line: %d, "
"call setrlimit fail, resource=%d (%s), value=%"PRId64", " \ "call setrlimit fail, resource=%d (%s), "
"errno: %d, error info: %s", \ "old value=%"PRId64", new value=%"PRId64", "
__LINE__, resource, label, (int64_t)value, \ "errno: %d, error info: %s", __LINE__, resource, label,
(int64_t)limit.rlim_cur, (int64_t)value,
errno, STRERROR(errno)); errno, STRERROR(errno));
return errno != 0 ? errno : EPERM; return errno != 0 ? errno : EPERM;
} }