Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157052026
D17682.id49548.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D17682.id49548.diff
View Options
Index: lib/libpmc/pmu-events/jevents.c
===================================================================
--- lib/libpmc/pmu-events/jevents.c
+++ lib/libpmc/pmu-events/jevents.c
@@ -34,7 +34,7 @@
*/
-#include <sys/stddef.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
@@ -54,8 +54,6 @@
#include "json.h"
#include "jevents.h"
-int snprintf(char * __restrict, size_t, const char * __restrict,
- ...) __printflike(3, 4);
_Noreturn void _Exit(int);
int verbose;
@@ -859,8 +857,11 @@
{
struct rlimit rlim;
- if (getrlimit(RLIMIT_NOFILE, &rlim) == 0)
- return min((int)rlim.rlim_max / 2, 512);
+ if (getrlimit(RLIMIT_NOFILE, &rlim) == 0) {
+ if (rlim.rlim_max == RLIM_INFINITY)
+ return 512;
+ return min((unsigned)rlim.rlim_max / 2, 512);
+ }
return 512;
}
@@ -1121,8 +1122,8 @@
mapfile = NULL;
rc = nftw(ldirname, preprocess_arch_std_files, maxfds, 0);
if (rc && verbose) {
- pr_info("%s: Error preprocessing arch standard files %s\n",
- prog, ldirname);
+ pr_info("%s: Error preprocessing arch standard files %s: %s\n",
+ prog, ldirname, strerror(errno));
goto empty_map;
} else if (rc < 0) {
/* Make build fail */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, May 19, 3:59 AM (21 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33290504
Default Alt Text
D17682.id49548.diff (1 KB)
Attached To
Mode
D17682: Fix get_maxfds() in jevents
Attached
Detach File
Event Timeline
Log In to Comment