Skip to content

Commit 9dab50d

Browse files
committed
Fix clang-detected issues.
1 parent 9d09e60 commit 9dab50d

3 files changed

Lines changed: 13 additions & 7 deletions

File tree

cups/file.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,7 +2215,9 @@ cups_open(const char *filename, // I - Filename
22152215
// Then verify that the file descriptor doesn't point to a directory or hard-linked file.
22162216
if (fstat(fd, &fileinfo))
22172217
{
2218+
int temp = errno;
22182219
close(fd);
2220+
errno = temp;
22192221
return (-1);
22202222
}
22212223

@@ -2241,7 +2243,9 @@ cups_open(const char *filename, // I - Filename
22412243
// Then use lstat to determine whether the filename is a symlink...
22422244
if (lstat(filename, &linkinfo))
22432245
{
2246+
int temp = errno;
22442247
close(fd);
2248+
errno = temp;
22452249
return (-1);
22462250
}
22472251

cups/ipp-file.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ struct _ipp_file_s // IPP data file
3333
cups_option_t *vars; // Variables
3434
ipp_fattr_cb_t attr_cb; // Attribute (filter) callback
3535
ipp_ferror_cb_t error_cb; // Error reporting callback
36-
ipp_ftoken_cb_t token_cb; // Token processing callback
3736
void *cb_data; // Callback data
3837
char *buffer; // Output buffer
3938
size_t alloc_buffer; // Size of output buffer

cups/oauth.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,12 +1331,15 @@ cupsOAuthGetTokens(
13311331

13321332
if (error)
13331333
{
1334-
// Handle "soft" device access token errors by setting access_expires to
1335-
// the next call time...
1336-
if (!strcmp(error, "slow_down"))
1337-
*access_expires = time(NULL) + 10;
1338-
else
1339-
*access_expires = time(NULL) + 5;
1334+
if (access_expires)
1335+
{
1336+
// Handle "soft" device access token errors by setting access_expires to
1337+
// the next call time...
1338+
if (!strcmp(error, "slow_down"))
1339+
*access_expires = time(NULL) + 10;
1340+
else
1341+
*access_expires = time(NULL) + 5;
1342+
}
13401343

13411344
// Free memory and return...
13421345
cupsJSONDelete(response);

0 commit comments

Comments
 (0)