mirror of
git://git.gnupg.org/gnupg.git
synced 2025-04-17 15:44:34 +02:00
Fix compiler warnings.
* common/dotlock.c (use_hardlinks_p, dotlock_take_unix): Check return value of link(). * g13/g13.c: Make sure err is initialized. * scd/scdaemon.c (main) [!USE_GCRY_THREAD_CBS]: Do not define ERR.
This commit is contained in:
parent
61ccd8d92d
commit
0dce26778e
@ -583,8 +583,11 @@ use_hardlinks_p (const char *tname)
|
|||||||
strcpy (lname, tname);
|
strcpy (lname, tname);
|
||||||
strcat (lname, "x");
|
strcat (lname, "x");
|
||||||
|
|
||||||
link (tname, lname);
|
res = link (tname, lname);
|
||||||
|
if (res < 0)
|
||||||
|
res = -1;
|
||||||
|
else
|
||||||
|
{
|
||||||
if (stat (tname, &sb))
|
if (stat (tname, &sb))
|
||||||
res = -1; /* Ooops. */
|
res = -1; /* Ooops. */
|
||||||
else if (sb.st_nlink == nlink + 1)
|
else if (sb.st_nlink == nlink + 1)
|
||||||
@ -593,6 +596,8 @@ use_hardlinks_p (const char *tname)
|
|||||||
res = 1; /* No hardlink support. */
|
res = 1; /* No hardlink support. */
|
||||||
|
|
||||||
unlink (lname);
|
unlink (lname);
|
||||||
|
}
|
||||||
|
|
||||||
jnlib_free (lname);
|
jnlib_free (lname);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -948,6 +953,7 @@ dotlock_destroy (dotlock_t h)
|
|||||||
static int
|
static int
|
||||||
dotlock_take_unix (dotlock_t h, long timeout)
|
dotlock_take_unix (dotlock_t h, long timeout)
|
||||||
{
|
{
|
||||||
|
int res;
|
||||||
int wtime = 0;
|
int wtime = 0;
|
||||||
int sumtime = 0;
|
int sumtime = 0;
|
||||||
int pid;
|
int pid;
|
||||||
@ -1004,7 +1010,13 @@ dotlock_take_unix (dotlock_t h, long timeout)
|
|||||||
{
|
{
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
|
|
||||||
link (h->tname, h->lockname);
|
res = link (h->tname, h->lockname);
|
||||||
|
if (res < 0)
|
||||||
|
{
|
||||||
|
my_error_1 ("lock not made: Oops: link of tmp file failed: %s\n",
|
||||||
|
strerror (errno));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (stat (h->tname, &sb))
|
if (stat (h->tname, &sb))
|
||||||
{
|
{
|
||||||
|
@ -686,6 +686,7 @@ main ( int argc, char **argv)
|
|||||||
#endif /*0*/
|
#endif /*0*/
|
||||||
|
|
||||||
/* Dispatch command. */
|
/* Dispatch command. */
|
||||||
|
err = 0;
|
||||||
switch (cmd)
|
switch (cmd)
|
||||||
{
|
{
|
||||||
case aGPGConfList:
|
case aGPGConfList:
|
||||||
|
@ -382,7 +382,9 @@ main (int argc, char **argv )
|
|||||||
{
|
{
|
||||||
ARGPARSE_ARGS pargs;
|
ARGPARSE_ARGS pargs;
|
||||||
int orig_argc;
|
int orig_argc;
|
||||||
|
#ifdef USE_GCRY_THREAD_CBS
|
||||||
gpg_error_t err;
|
gpg_error_t err;
|
||||||
|
#endif
|
||||||
char **orig_argv;
|
char **orig_argv;
|
||||||
FILE *configfp = NULL;
|
FILE *configfp = NULL;
|
||||||
char *configname = NULL;
|
char *configname = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user