chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update fixme
[elogind.git]
/
src
/
util.c
diff --git
a/src/util.c
b/src/util.c
index c2ef34dd4378af94500e6cfe3a830186a920c013..3bcce2f019bcf6af535d5f4942d135185da4a870 100644
(file)
--- a/
src/util.c
+++ b/
src/util.c
@@
-1,4
+1,4
@@
-/*-*- Mode: C; c-basic-offset: 8 -*-*/
+/*-*- Mode: C; c-basic-offset: 8
; indent-tabs-mode: nil
-*-*/
/***
This file is part of systemd.
/***
This file is part of systemd.
@@
-2531,11
+2531,12
@@
char* getlogname_malloc(void) {
int getttyname_malloc(char **r) {
char path[PATH_MAX], *p, *c;
int getttyname_malloc(char **r) {
char path[PATH_MAX], *p, *c;
+ int k;
assert(r);
assert(r);
- if (
ttyname_r(STDIN_FILENO, path, sizeof(path)) <
0)
- return -
errno
;
+ if (
(k = ttyname_r(STDIN_FILENO, path, sizeof(path))) !=
0)
+ return -
k
;
char_array_0(path);
char_array_0(path);
@@
-2997,6
+2998,17
@@
void nss_disable_nscd(void) {
log_debug("Cannot disable nscd.");
}
log_debug("Cannot disable nscd.");
}
+int touch(const char *path) {
+ int fd;
+
+ assert(path);
+
+ if ((fd = open(path, O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY, 0666)) < 0)
+ return -errno;
+
+ close_nointr_nofail(fd);
+ return 0;
+}
static const char *const ioprio_class_table[] = {
[IOPRIO_CLASS_NONE] = "none",
static const char *const ioprio_class_table[] = {
[IOPRIO_CLASS_NONE] = "none",