This commit is contained in:
Wolfgang Hottgenroth 2021-04-29 17:25:38 +02:00
parent c8f02dd74d
commit 7379a915bb
Signed by: wn
GPG Key ID: 6C1E5E531E0D5D7F

View File

@ -116,12 +116,11 @@ int findDevice(t_commonHandle *handle, char *deviceId) {
PGresult *res2 = PQexec(handle->conn, stmt);
ExecStatusType execStatus = PQresultStatus(res2);
if (execStatus != PGRES_TUPLES_OK) {
logmsg(LOG_INFO, "findDevice query fails, database returns %s", PQresStatus(execStatus));
logmsg(LOG_ERR, "findDevice query fails, database returns %s", PQresStatus(execStatus));
retCode = -2;
} else {
int ntuples = PQntuples(res2);
if (ntuples == 1) {
logmsg(LOG_DEBUG, "device found");
handle->foundDevice.deviceResult = res2;
handle->foundDevice.sharedSecret = PQgetvalue(res2, 0, 0);
handle->foundDevice.inactive = (strcmp(PQgetvalue(res2, 0, 1), "f") == 0);