Skip to content
Snippets Groups Projects
Commit db7a5601 authored by Clara Daia Hilgenberg Daru's avatar Clara Daia Hilgenberg Daru
Browse files

Remove unwanted exit

parent 174ef7ff
No related branches found
No related tags found
No related merge requests found
build/* build/*
bin/* bin/*
test/docker/*/agent/* test/docker/*/agent/*
test/log.txt
...@@ -294,7 +294,7 @@ static struct user_log * last_modified () { ...@@ -294,7 +294,7 @@ static struct user_log * last_modified () {
if (x == ENOENT) if (x == ENOENT)
fprintf(stderr, "Perhaps this file was removed by the " fprintf(stderr, "Perhaps this file was removed by the "
"operator to prevent logging info.\n"); "operator to prevent logging info.\n");
exit(1); return NULL;
} }
/* /*
...@@ -425,7 +425,8 @@ static struct user_log * last_modified () { ...@@ -425,7 +425,8 @@ static struct user_log * last_modified () {
break; break;
if ((p = (struct utmplist *)malloc(sizeof(struct utmplist))) == NULL) { if ((p = (struct utmplist *)malloc(sizeof(struct utmplist))) == NULL) {
fprintf(stderr, "ERROR: out of memory\n"); fprintf(stderr, "ERROR: out of memory\n");
exit(1); return NULL;
} }
memcpy(&p->ut, &ut, sizeof(struct utmp)); memcpy(&p->ut, &ut, sizeof(struct utmp));
p->next = utmplist; p->next = utmplist;
...@@ -542,7 +543,7 @@ static struct user_log * last_modified () { ...@@ -542,7 +543,7 @@ static struct user_log * last_modified () {
break; break;
if ((p = (struct utmplist *)malloc(sizeof(struct utmplist))) == NULL) { if ((p = (struct utmplist *)malloc(sizeof(struct utmplist))) == NULL) {
fprintf(stderr, "ERROR: out of memory\n"); fprintf(stderr, "ERROR: out of memory\n");
exit(1); return NULL;
} }
memcpy(&p->ut, &ut, sizeof(struct utmp)); memcpy(&p->ut, &ut, sizeof(struct utmp));
p->next = utmplist; p->next = utmplist;
...@@ -575,7 +576,7 @@ int get_user_count () { ...@@ -575,7 +576,7 @@ int get_user_count () {
strftime (yesterday,7,"%y%m%d",timeinfo); strftime (yesterday,7,"%y%m%d",timeinfo);
yesterday[6] = '\0'; yesterday[6] = '\0';
for(i = u; i; i = u){ for(i = u; i; i = u){
if(!strcmp(i->logout,"999999")){ if(!strcmp(i->logout,"999999")){
if(strcmp(i->login,yesterday) <= 0){ if(strcmp(i->login,yesterday) <= 0){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment