summaryrefslogtreecommitdiff
path: root/src/shared/util.c
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2014-10-13 08:39:08 -0400
committerAnthony G. Basile <blueness@gentoo.org>2014-10-13 08:39:08 -0400
commit737d6ff89b534bf9e57309e06b982b614d05e9e3 (patch)
treea2fe9c8e5882a77bd41e42eadba12584b5703d4f /src/shared/util.c
parentb7b6d29a5914f2a183545d3ed2bd4387da61956e (diff)
src/shared/util.c: final cosmetic change
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/shared/util.c')
-rw-r--r--src/shared/util.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 5ad206a6c2..691a876872 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -829,6 +829,26 @@ bool nulstr_contains(const char*nulstr, const char *needle) {
return false;
}
+int fd_wait_for_event(int fd, int event, usec_t t) {
+
+ struct pollfd pollfd = {
+ .fd = fd,
+ .events = event,
+ };
+
+ struct timespec ts;
+ int r;
+
+ r = ppoll(&pollfd, 1, t == USEC_INFINITY ? NULL : timespec_store(&ts, t), NULL);
+ if (r < 0)
+ return -errno;
+
+ if (r == 0)
+ return 0;
+
+ return pollfd.revents;
+}
+
int fopen_temporary(const char *path, FILE **_f, char **_temp_path) {
FILE *f;
char *t;
@@ -1190,26 +1210,6 @@ const char *signal_to_string(int signo) {
return buf;
}
-int fd_wait_for_event(int fd, int event, usec_t t) {
-
- struct pollfd pollfd = {
- .fd = fd,
- .events = event,
- };
-
- struct timespec ts;
- int r;
-
- r = ppoll(&pollfd, 1, t == USEC_INFINITY ? NULL : timespec_store(&ts, t), NULL);
- if (r < 0)
- return -errno;
-
- if (r == 0)
- return 0;
-
- return pollfd.revents;
-}
-
int fd_inc_sndbuf(int fd, size_t n) {
int r, value;
socklen_t l = sizeof(value);