-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
duplicated fs, hiding cruft, porting issues #9
base: master
Are you sure you want to change the base?
Changes from all commits
fcd1920
e92b830
50eb2ec
fc71744
aa44e72
4072223
3f0e559
7b1af23
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,20 +34,22 @@ | |
* | ||
* Linux implemention of services. | ||
*/ | ||
#ifdef __linux__ | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#include <unistd.h> | ||
|
||
#if defined(__linux__) || defined(__GLIBC__) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason to move the check down? I'd like it to be at the very top because this file is linux/glibc specific. But I'm being picky, I'll move it back at the top after merging. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I'll fire up a VM with Alpine Linux and see how it behaves. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, it builds fine in Alpine Linux which uses musl. I'll leave it as is then. |
||
|
||
#ifdef NLS_ENABLED | ||
#include <locale.h> | ||
#include <libintl.h> | ||
#endif /* NLS_ENABLED */ | ||
|
||
#include <mntent.h> | ||
#include <sys/statvfs.h> | ||
#include <errno.h> | ||
|
||
#include "extern.h" | ||
#include "services.h" | ||
|
@@ -101,6 +103,9 @@ fetch_info(struct list *lst) | |
continue; | ||
/* get infos from statvfs */ | ||
if (statvfs(entbuf->mnt_dir, &vfsbuf) == -1) { | ||
/* show only "real" errors, not lack of permissions */ | ||
if (errno == EACCES) | ||
continue; | ||
/* display a warning when a FS cannot be stated */ | ||
(void)fprintf(stderr, _("WARNING: %s was skipped " | ||
"because it could not be stated"), | ||
|
@@ -152,8 +157,6 @@ fetch_info(struct list *lst) | |
|
||
/* enqueue the element into the queue */ | ||
enqueue(lst, *fmi); | ||
|
||
update_maxwidth(fmi); | ||
} | ||
/* we need to close the mtab file now */ | ||
if (fclose(mtab) == EOF) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I guess it is fine as-is. It won't hurt platforms which are not concerned by this anyway.