From: Nick Porter Date: Wed, 23 Nov 2022 08:24:51 +0000 (+0000) Subject: Remove duplicate code X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9c4c1cdfe47d2a2ac2ff82fe197b612b5ffad75;p=thirdparty%2Ffreeradius-server.git Remove duplicate code --- diff --git a/src/modules/rlm_linelog/rlm_linelog.c b/src/modules/rlm_linelog/rlm_linelog.c index bdd09d75fb3..5f0c8bcfc99 100644 --- a/src/modules/rlm_linelog/rlm_linelog.c +++ b/src/modules/rlm_linelog/rlm_linelog.c @@ -710,6 +710,7 @@ build_vector: } if (writev(fd, &head_vector_s[0], head_vector_len) < 0) { + write_fail: RERROR("Failed writing to \"%s\": %s", path, fr_syserror(errno)); exfile_close(inst->file.ef, fd); @@ -720,15 +721,7 @@ build_vector: } } - if (writev(fd, vector_p, vector_len) < 0) { - RERROR("Failed writing to \"%s\": %s", path, fr_syserror(errno)); - exfile_close(inst->file.ef, fd); - - /* Assert on the extra fatal errors */ - fr_assert((errno != EINVAL) && (errno != EFAULT)); - - RETURN_MODULE_FAIL; - } + if (writev(fd, vector_p, vector_len) < 0) goto write_fail; exfile_close(inst->file.ef, fd); }