summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/pututxline.c
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2011-02-25 23:05:35 +0000
committered <ed@FreeBSD.org>2011-02-25 23:05:35 +0000
commit95b5e9a623924c06a584b13f12720c5f39222303 (patch)
tree0d72e556acb25ccec483d4b6ee02e8d51fae51db /lib/libc/gen/pututxline.c
parentc15901a533e69ff39238a870e80c0922360afd80 (diff)
downloadFreeBSD-src-95b5e9a623924c06a584b13f12720c5f39222303.zip
FreeBSD-src-95b5e9a623924c06a584b13f12720c5f39222303.tar.gz
Fix style(9) issues in pututxline(3).
Also, make sure to initialize the `ret' variable properly. Reported by: Cedric Jonas <cedric c84 eu> Patch by: Garrett Cooper <yanegomi gmail com>
Diffstat (limited to 'lib/libc/gen/pututxline.c')
-rw-r--r--lib/libc/gen/pututxline.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/libc/gen/pututxline.c b/lib/libc/gen/pututxline.c
index 731817f..4caa00c 100644
--- a/lib/libc/gen/pututxline.c
+++ b/lib/libc/gen/pututxline.c
@@ -43,8 +43,8 @@ __FBSDID("$FreeBSD$");
static FILE *
futx_open(const char *file)
{
- struct stat sb;
FILE *fp;
+ struct stat sb;
int fd;
fd = _open(file, O_CREAT|O_RDWR|O_EXLOCK, 0644);
@@ -69,11 +69,14 @@ futx_open(const char *file)
static int
utx_active_add(const struct futx *fu)
{
- struct futx fe;
FILE *fp;
- off_t partial = -1;
+ struct futx fe;
+ off_t partial;
int error, ret;
+ partial = -1;
+ ret = 0;
+
/*
* Register user login sessions. Overwrite entries of sessions
* that have already been terminated.
@@ -132,8 +135,8 @@ exact:
static int
utx_active_remove(struct futx *fu)
{
- struct futx fe;
FILE *fp;
+ struct futx fe;
int error, ret;
/*
@@ -266,7 +269,9 @@ struct utmpx *
pututxline(const struct utmpx *utmpx)
{
struct futx fu;
- int bad = 0;
+ int bad;
+
+ bad = 0;
utx_to_futx(utmpx, &fu);
OpenPOWER on IntegriCloud