Skip to content

Commit 28de514

Browse files
committed
linux, netbsd: Give statvfs a Default impl
On Linux these recently gained a new field, which is technically breaking. Smooth this over a bit by switching to `s2` to get `Default` implemented. (backport <#5583>) (cherry picked from commit 40422af)
1 parent a58a95f commit 28de514

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎src/new/glibc/sysdeps/unix/linux/bits/statvfs.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use crate::prelude::*;
44

5-
s! {
5+
s2! {
66
pub struct statvfs {
77
pub f_bsize: c_ulong,
88
pub f_frsize: c_ulong,

‎src/new/netbsd/sys/statvfs.rs‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::prelude::*;
77
const _VFS_NAMELEN: usize = 32;
88
const _VFS_MNAMELEN: usize = 1024;
99

10-
s! {
10+
s2! {
1111
pub struct statvfs {
1212
pub f_flag: c_ulong,
1313
pub f_bsize: c_ulong,
@@ -38,8 +38,11 @@ s! {
3838
// This type is updated in a future version
3939
f_spare: Padding<[u32; 4]>,
4040

41+
#[custom_default([0; _VFS_NAMELEN])]
4142
pub f_fstypename: [c_char; _VFS_NAMELEN],
43+
#[custom_default([0; _VFS_MNAMELEN])]
4244
pub f_mntonname: [c_char; _VFS_MNAMELEN],
45+
#[custom_default([0; _VFS_MNAMELEN])]
4346
pub f_mntfromname: [c_char; _VFS_MNAMELEN],
4447
// Added in NetBSD10
4548
// pub f_mntfromlabel: [c_char; _VFS_MNAMELEN],

0 commit comments

Comments
 (0)