]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Remove duplicate code
authorNick Porter <nick@portercomputing.co.uk>
Wed, 23 Nov 2022 08:24:51 +0000 (08:24 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Wed, 23 Nov 2022 08:24:51 +0000 (08:24 +0000)
src/modules/rlm_linelog/rlm_linelog.c

index bdd09d75fb3a13488caa31a015566e8a6748e170..5f0c8bcfc99ec5daf93860b61be2491f3d3cd2a9 100644 (file)
@@ -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);
        }