k9core

Unnamed repository
Log | Files | Refs | LICENSE

commit 59d1ef677ae3bb87ba9651f3afb06f7ffe11cd65
parent b574d181741fb6382338f4c6f243982d2d235b85
Author: qorg11 <qorg@vxempire.xyz>
Date:   Mon, 13 Jul 2020 20:09:42 +0200

Better errno

Diffstat:
Msrc/id.c | 4++--
Msrc/mount.c | 2+-
Msrc/umount.c | 3++-
3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/id.c b/src/id.c @@ -18,8 +18,8 @@ main(int argc, char *argv[]) break; default: printf("%u %s\n",user_data->pw_gid,user_data->pw_name); /* I know - * it does not work - * like this */ + * it does not work + * like this */ } return 0; diff --git a/src/mount.c b/src/mount.c @@ -39,7 +39,7 @@ main(int argc, char *argv[]) { int fd = mount(argv[source],argv[destination],filesystem,0,NULL); if(fd == -1) { - fprintf(stderr,"error mounting: %i\n",errno); + fprintf(stderr,"error mounting: %i = %s\n",errno,strerror(errno)); } return 0; } diff --git a/src/umount.c b/src/umount.c @@ -2,6 +2,7 @@ #include <sys/mount.h> #include <errno.h> #include <getopt.h> +#include <string.h> int main(int argc, char *argv[]) @@ -22,6 +23,6 @@ main(int argc, char *argv[]) int fd = umount2(argv[destination],options); if(fd == -1) { - printf("error umounting: %i\n",errno); + printf("error umounting: %i = %s\n",errno,strerror(errno)); } }