Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
systemd
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
steam
systemd
Commits
bb00e604
Commit
bb00e604
authored
Jun 19, 2010
by
Lennart Poettering
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't use 'long long' unless we have a really good reason to
parent
6cf6bbc2
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
32 additions
and
34 deletions
+32
-34
fixme
fixme
+0
-2
src/execute.c
src/execute.c
+4
-4
src/initctl.c
src/initctl.c
+2
-2
src/log.c
src/log.c
+2
-2
src/logger.c
src/logger.c
+3
-3
src/main.c
src/main.c
+2
-2
src/manager.c
src/manager.c
+3
-3
src/mount.c
src/mount.c
+2
-2
src/service.c
src/service.c
+4
-4
src/socket.c
src/socket.c
+5
-5
src/util.c
src/util.c
+5
-5
No files found.
fixme
View file @
bb00e604
...
...
@@ -18,8 +18,6 @@
* "disabled" load state?
* uid are 32bit
* %m in printf() instead of strerror();
* gc: don't reap broken services
...
...
src/execute.c
View file @
bb00e604
...
...
@@ -1213,7 +1213,7 @@ int exec_spawn(ExecCommand *command,
}
if
(
n_fds
>
0
)
if
(
asprintf
(
our_env
+
n_env
++
,
"LISTEN_PID=%l
lu"
,
(
unsigned
long
long
)
getpid
())
<
0
||
if
(
asprintf
(
our_env
+
n_env
++
,
"LISTEN_PID=%l
u"
,
(
unsigned
long
)
getpid
())
<
0
||
asprintf
(
our_env
+
n_env
++
,
"LISTEN_FDS=%u"
,
n_fds
)
<
0
)
{
r
=
EXIT_MEMORY
;
goto
fail
;
...
...
@@ -1270,7 +1270,7 @@ int exec_spawn(ExecCommand *command,
if
(
cgroup_bondings
)
cgroup_bonding_install_list
(
cgroup_bondings
,
pid
);
log_debug
(
"Forked %s as %l
lu"
,
command
->
path
,
(
unsigned
long
long
)
pid
);
log_debug
(
"Forked %s as %l
u"
,
command
->
path
,
(
unsigned
long
)
pid
);
command
->
exec_status
.
pid
=
pid
;
command
->
exec_status
.
start_timestamp
=
now
(
CLOCK_REALTIME
);
...
...
@@ -1572,8 +1572,8 @@ void exec_status_dump(ExecStatus *s, FILE *f, const char *prefix) {
return
;
fprintf
(
f
,
"%sPID: %l
l
u
\n
"
,
prefix
,
(
unsigned
long
long
)
s
->
pid
);
"%sPID: %lu
\n
"
,
prefix
,
(
unsigned
long
)
s
->
pid
);
if
(
s
->
start_timestamp
>
0
)
fprintf
(
f
,
...
...
src/initctl.c
View file @
bb00e604
...
...
@@ -339,7 +339,7 @@ int main(int argc, char *argv[]) {
log_set_target
(
LOG_TARGET_SYSLOG_OR_KMSG
);
log_parse_environment
();
log_info
(
"systemd-initctl running as pid %l
lu"
,
(
unsigned
long
long
)
getpid
());
log_info
(
"systemd-initctl running as pid %l
u"
,
(
unsigned
long
)
getpid
());
if
((
n
=
sd_listen_fds
(
true
))
<
0
)
{
log_error
(
"Failed to read listening file descriptors from environment: %s"
,
strerror
(
-
r
));
...
...
@@ -387,7 +387,7 @@ fail:
server_done
(
&
server
);
log_info
(
"systemd-initctl stopped as pid %l
lu"
,
(
unsigned
long
long
)
getpid
());
log_info
(
"systemd-initctl stopped as pid %l
u"
,
(
unsigned
long
)
getpid
());
dbus_shutdown
();
...
...
src/log.c
View file @
bb00e604
...
...
@@ -265,7 +265,7 @@ static int write_to_syslog(
if
(
strftime
(
header_time
,
sizeof
(
header_time
),
"%h %e %T "
,
tm
)
<=
0
)
return
-
EINVAL
;
snprintf
(
header_pid
,
sizeof
(
header_pid
),
"[%l
lu]: "
,
(
unsigned
long
long
)
getpid
());
snprintf
(
header_pid
,
sizeof
(
header_pid
),
"[%l
u]: "
,
(
unsigned
long
)
getpid
());
char_array_0
(
header_pid
);
zero
(
iovec
);
...
...
@@ -301,7 +301,7 @@ static int write_to_kmsg(
snprintf
(
header_priority
,
sizeof
(
header_priority
),
"<%i>"
,
LOG_PRI
(
level
));
char_array_0
(
header_priority
);
snprintf
(
header_pid
,
sizeof
(
header_pid
),
"[%l
lu]: "
,
(
unsigned
long
long
)
getpid
());
snprintf
(
header_pid
,
sizeof
(
header_pid
),
"[%l
u]: "
,
(
unsigned
long
)
getpid
());
char_array_0
(
header_pid
);
zero
(
iovec
);
...
...
src/logger.c
View file @
bb00e604
...
...
@@ -143,7 +143,7 @@ static int stream_log(Stream *s, char *p, usec_t ts) {
return
-
EINVAL
;
}
snprintf
(
header_pid
,
sizeof
(
header_pid
),
"[%l
lu]: "
,
(
unsigned
long
long
)
s
->
pid
);
snprintf
(
header_pid
,
sizeof
(
header_pid
),
"[%l
u]: "
,
(
unsigned
long
)
s
->
pid
);
char_array_0
(
header_pid
);
zero
(
iovec
);
...
...
@@ -538,7 +538,7 @@ int main(int argc, char *argv[]) {
log_set_target
(
LOG_TARGET_SYSLOG_OR_KMSG
);
log_parse_environment
();
log_info
(
"systemd-logger running as pid %l
lu"
,
(
unsigned
long
long
)
getpid
());
log_info
(
"systemd-logger running as pid %l
u"
,
(
unsigned
long
)
getpid
());
if
((
n
=
sd_listen_fds
(
true
))
<
0
)
{
log_error
(
"Failed to read listening file descriptors from environment: %s"
,
strerror
(
-
r
));
...
...
@@ -586,7 +586,7 @@ fail:
server_done
(
&
server
);
log_info
(
"systemd-logger stopped as pid %l
lu"
,
(
unsigned
long
long
)
getpid
());
log_info
(
"systemd-logger stopped as pid %l
u"
,
(
unsigned
long
)
getpid
());
return
r
;
}
src/main.c
View file @
bb00e604
...
...
@@ -116,7 +116,7 @@ _noreturn_ static void crash(int sig) {
else
if
(
!
WCOREDUMP
(
status
))
log_error
(
"Caught <%s>, core dump failed."
,
strsignal
(
sig
));
else
log_error
(
"Caught <%s>, dumped core as pid %l
lu."
,
strsignal
(
sig
),
(
unsigned
long
long
)
pid
);
log_error
(
"Caught <%s>, dumped core as pid %l
u."
,
strsignal
(
sig
),
(
unsigned
long
)
pid
);
}
}
...
...
@@ -152,7 +152,7 @@ _noreturn_ static void crash(int sig) {
_exit
(
1
);
}
log_info
(
"Successfully spawned crash shall as pid %l
lu."
,
(
unsigned
long
long
)
pid
);
log_info
(
"Successfully spawned crash shall as pid %l
u."
,
(
unsigned
long
)
pid
);
}
log_info
(
"Freezing execution."
);
...
...
src/manager.c
View file @
bb00e604
...
...
@@ -1701,7 +1701,7 @@ static int manager_dispatch_sigchld(Manager *m) {
char
*
name
=
NULL
;
get_process_name
(
si
.
si_pid
,
&
name
);
log_debug
(
"Got SIGCHLD for process %l
lu (%s)"
,
(
unsigned
long
long
)
si
.
si_pid
,
strna
(
name
));
log_debug
(
"Got SIGCHLD for process %l
u (%s)"
,
(
unsigned
long
)
si
.
si_pid
,
strna
(
name
));
free
(
name
);
}
...
...
@@ -1727,8 +1727,8 @@ static int manager_dispatch_sigchld(Manager *m) {
if
(
si
.
si_code
!=
CLD_EXITED
&&
si
.
si_code
!=
CLD_KILLED
&&
si
.
si_code
!=
CLD_DUMPED
)
continue
;
log_debug
(
"Child %l
l
u died (code=%s, status=%i/%s)"
,
(
long
long
unsigned
)
si
.
si_pid
,
log_debug
(
"Child %lu died (code=%s, status=%i/%s)"
,
(
long
unsigned
)
si
.
si_pid
,
sigchld_code_to_string
(
si
.
si_code
),
si
.
si_status
,
strna
(
si
.
si_code
==
CLD_EXITED
?
exit_status_to_string
(
si
.
si_status
)
:
strsignal
(
si
.
si_status
)));
...
...
src/mount.c
View file @
bb00e604
...
...
@@ -505,8 +505,8 @@ static void mount_dump(Unit *u, FILE *f, const char *prefix) {
if
(
m
->
control_pid
>
0
)
fprintf
(
f
,
"%sControl PID: %l
l
u
\n
"
,
prefix
,
(
unsigned
long
long
)
m
->
control_pid
);
"%sControl PID: %lu
\n
"
,
prefix
,
(
unsigned
long
)
m
->
control_pid
);
exec_context_dump
(
&
m
->
exec_context
,
f
,
prefix
);
}
...
...
src/service.c
View file @
bb00e604
...
...
@@ -904,13 +904,13 @@ static void service_dump(Unit *u, FILE *f, const char *prefix) {
if
(
s
->
control_pid
>
0
)
fprintf
(
f
,
"%sControl PID: %l
l
u
\n
"
,
prefix
,
(
unsigned
long
long
)
s
->
control_pid
);
"%sControl PID: %lu
\n
"
,
prefix
,
(
unsigned
long
)
s
->
control_pid
);
if
(
s
->
main_pid
>
0
)
fprintf
(
f
,
"%sMain PID: %l
l
u
\n
"
,
prefix
,
(
unsigned
long
long
)
s
->
main_pid
);
"%sMain PID: %lu
\n
"
,
prefix
,
(
unsigned
long
)
s
->
main_pid
);
if
(
s
->
pid_file
)
fprintf
(
f
,
...
...
src/socket.c
View file @
bb00e604
...
...
@@ -313,8 +313,8 @@ static void socket_dump(Unit *u, FILE *f, const char *prefix) {
if
(
s
->
control_pid
>
0
)
fprintf
(
f
,
"%sControl PID: %l
l
u
\n
"
,
prefix
,
(
unsigned
long
long
)
s
->
control_pid
);
"%sControl PID: %lu
\n
"
,
prefix
,
(
unsigned
long
)
s
->
control_pid
);
if
(
s
->
bind_to_device
)
fprintf
(
f
,
...
...
@@ -447,10 +447,10 @@ static int instance_from_socket(int fd, unsigned nr, char **instance) {
return
-
errno
;
if
(
asprintf
(
&
r
,
"%u-%l
lu-%l
lu"
,
"%u-%l
u-%
lu"
,
nr
,
(
unsigned
long
long
)
ucred
.
pid
,
(
unsigned
long
long
)
ucred
.
uid
)
<
0
)
(
unsigned
long
)
ucred
.
pid
,
(
unsigned
long
)
ucred
.
uid
)
<
0
)
return
-
ENOMEM
;
break
;
...
...
src/util.c
View file @
bb00e604
...
...
@@ -446,12 +446,12 @@ int get_parent_of_pid(pid_t pid, pid_t *_ppid) {
int
r
;
FILE
*
f
;
char
fn
[
132
],
line
[
256
],
*
p
;
long
long
unsigned
ppid
;
long
unsigned
ppid
;
assert
(
pid
>=
0
);
assert
(
_ppid
);
assert_se
(
snprintf
(
fn
,
sizeof
(
fn
)
-
1
,
"/proc/%l
lu/stat"
,
(
unsigned
long
long
)
pid
)
<
(
int
)
(
sizeof
(
fn
)
-
1
));
assert_se
(
snprintf
(
fn
,
sizeof
(
fn
)
-
1
,
"/proc/%l
u/stat"
,
(
unsigned
long
)
pid
)
<
(
int
)
(
sizeof
(
fn
)
-
1
));
fn
[
sizeof
(
fn
)
-
1
]
=
0
;
if
(
!
(
f
=
fopen
(
fn
,
"r"
)))
...
...
@@ -476,11 +476,11 @@ int get_parent_of_pid(pid_t pid, pid_t *_ppid) {
if
(
sscanf
(
p
,
" "
"%*c "
/* state */
"%l
l
u "
,
/* ppid */
"%lu "
,
/* ppid */
&
ppid
)
!=
1
)
return
-
EIO
;
if
((
long
long
unsigned
)
(
pid_t
)
ppid
!=
ppid
)
if
((
long
unsigned
)
(
pid_t
)
ppid
!=
ppid
)
return
-
ERANGE
;
*
_ppid
=
(
pid_t
)
ppid
;
...
...
@@ -552,7 +552,7 @@ int get_process_name(pid_t pid, char **name) {
assert
(
pid
>=
1
);
assert
(
name
);
if
(
asprintf
(
&
p
,
"/proc/%l
lu/comm"
,
(
unsigned
long
long
)
pid
)
<
0
)
if
(
asprintf
(
&
p
,
"/proc/%l
u/comm"
,
(
unsigned
long
)
pid
)
<
0
)
return
-
ENOMEM
;
r
=
read_one_line_file
(
p
,
name
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment