Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153283081
D6626.id.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
D6626.id.diff
View Options
Index: head/sbin/swapon/swapon.c
===================================================================
--- head/sbin/swapon/swapon.c
+++ head/sbin/swapon/swapon.c
@@ -216,7 +216,7 @@
static const char *
swap_on_off(const char *name, int doingall, char *mntops)
{
- char base[PATH_MAX];
+ char *base, *basebuf;
/* Swap on vnode-backed md(4) device. */
if (mntops != NULL &&
@@ -227,17 +227,23 @@
strncmp(MD_NAME, name, sizeof(MD_NAME)) == 0))
return (swap_on_off_md(name, mntops, doingall));
- basename_r(name, base);
+ basebuf = strdup(name);
+ base = basename(basebuf);
/* Swap on encrypted device by GEOM_BDE. */
- if (fnmatch("*.bde", base, 0) == 0)
+ if (fnmatch("*.bde", base, 0) == 0) {
+ free(basebuf);
return (swap_on_off_gbde(name, doingall));
+ }
/* Swap on encrypted device by GEOM_ELI. */
- if (fnmatch("*.eli", base, 0) == 0)
+ if (fnmatch("*.eli", base, 0) == 0) {
+ free(basebuf);
return (swap_on_off_geli(name, mntops, doingall));
+ }
/* Swap on special file. */
+ free(basebuf);
return (swap_on_off_sfile(name, doingall));
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 21, 5:56 AM (11 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31892788
Default Alt Text
D6626.id.diff (1 KB)
Attached To
Mode
D6626: Stop using the non-standard basename_r() function.
Attached
Detach File
Event Timeline
Log In to Comment