Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
agent
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
simmctic
agent
Commits
db7a5601
Commit
db7a5601
authored
8 years ago
by
Clara Daia Hilgenberg Daru
Browse files
Options
Downloads
Patches
Plain Diff
Remove unwanted exit
parent
174ef7ff
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
src/linux/get_user_count.cpp
+5
-4
5 additions, 4 deletions
src/linux/get_user_count.cpp
with
6 additions
and
4 deletions
.gitignore
+
1
−
0
View file @
db7a5601
build/*
build/*
bin/*
bin/*
test/docker/*/agent/*
test/docker/*/agent/*
test/log.txt
This diff is collapsed.
Click to expand it.
src/linux/get_user_count.cpp
+
5
−
4
View file @
db7a5601
...
@@ -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
){
...
...
This diff is collapsed.
Click to expand it.
Clara Daia Hilgenberg Daru
@cdhd12
mentioned in commit
eafa6912
·
8 years ago
mentioned in commit
eafa6912
mentioned in commit eafa691256d909a8f3082d2f9c5355c8faef9d10
Toggle commit list
Clara Daia Hilgenberg Daru
@cdhd12
mentioned in merge request
!4 (merged)
·
8 years ago
mentioned in merge request
!4 (merged)
mentioned in merge request !4
Toggle commit list
Clara Daia Hilgenberg Daru
@cdhd12
mentioned in commit
4ba93664
·
8 years ago
mentioned in commit
4ba93664
mentioned in commit 4ba93664fc06651bfa286292bd61d7331a96164a
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment