]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix typo in comparison, so that we check the return of write()
authorAlan T. DeKok <aland@freeradius.org>
Sat, 1 Dec 2012 00:38:53 +0000 (19:38 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 1 Dec 2012 00:38:53 +0000 (19:38 -0500)
src/modules/rlm_sql/sql.c

index 4959390f238ee182ffc04e0ee27249ab8a71ecf9..f2e1d2b99c1c256de1c2d8852814b9523f2de7db 100644 (file)
@@ -438,9 +438,10 @@ void rlm_sql_query_log(SQL_INST *inst, REQUEST *request,
        }
 
        rad_lockfd(fd, MAX_QUERY_LEN);
-       if ((write(fd, query, strlen(query) < 0) || (write(fd, ";\n", 2) < 0)))
+       if ((write(fd, query, strlen(query)) < 0) ||
+           (write(fd, ";\n", 2) < 0)) {
                radlog(L_ERR, "rlm_sql (%s): Failed writing to logfile '%s': %s",
                       inst->config->xlat_name, buffer, strerror(errno));
-
+       }
        close(fd);              /* and release the lock */
 }