summaryrefslogtreecommitdiff
path: root/src/commands/groups.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/groups.c')
-rw-r--r--src/commands/groups.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/commands/groups.c b/src/commands/groups.c
index aea92af..763f294 100644
--- a/src/commands/groups.c
+++ b/src/commands/groups.c
@@ -9,7 +9,7 @@ COMMAND_EMPTY(groups) {
struct passwd* pw = getpwuid(uid);
if(pw == NULL){
- perror("error: failed to fetch groups: ");
+ error("failed to fetch groups: %s", strerror(errno));
}
int ngroups = 0;
@@ -21,7 +21,7 @@ COMMAND_EMPTY(groups) {
for (int i = 0; i < ngroups; i++){
struct group* gr = getgrgid(groups[i]);
if(gr == NULL){
- perror("error: failed to fetch groups: ");
+ error("failed to fetch groups: %s", strerror(errno));
}
printf("%s ",gr->gr_name);
}