Allow standalone build.

This commit is contained in:
Werner Koch 2008-03-26 17:44:56 +00:00
parent 074eed94f5
commit dc2de957b3
2 changed files with 20 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2008-03-26 Werner Koch <wk@g10code.com>
* make-dns-cert.c: Include unistd.h. Use config.h if requested.
(cert_key): Protect read against EINTR.
(main): Print SVN revision for standalone version.
2008-03-05 Werner Koch <wk@g10code.com> 2008-03-05 Werner Koch <wk@g10code.com>
* gpg-connect-agent.c (arithmetic_op): Add logical not, or and and. * gpg-connect-agent.c (arithmetic_op): Add logical not, or and and.

View File

@ -1,5 +1,5 @@
/* make-dns-cert.c - An OpenPGP-to-DNS CERT conversion tool /* make-dns-cert.c - An OpenPGP-to-DNS CERT conversion tool
* Copyright (C) 2006 Free Software Foundation, Inc. * Copyright (C) 2006, 2008 Free Software Foundation, Inc.
* *
* This file is part of GnuPG. * This file is part of GnuPG.
* *
@ -17,7 +17,10 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
#include <config.h> #ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <unistd.h> #include <unistd.h>
#ifdef HAVE_GETOPT_H #ifdef HAVE_GETOPT_H
#include <getopt.h> #include <getopt.h>
@ -26,6 +29,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
@ -72,7 +76,9 @@ cert_key(const char *name,const char *keyfile)
{ {
unsigned char buffer[1024]; unsigned char buffer[1024];
err=read(fd,buffer,1024); do
err = read (fd,buffer,1024);
while (err == -1 && errno == EINTR);
if(err==-1) if(err==-1)
{ {
fprintf(stderr,"Unable to read key file %s: %s\n", fprintf(stderr,"Unable to read key file %s: %s\n",
@ -181,7 +187,11 @@ main(int argc,char *argv[])
} }
else if(argc>1 && strcmp(argv[1],"--version")==0) else if(argc>1 && strcmp(argv[1],"--version")==0)
{ {
printf("make-dns-cert (GnuPG) " VERSION "\n"); #if defined(HAVE_CONFIG_H) && defined(VERSION)
printf ("make-dns-cert (GnuPG) " VERSION "\n");
#else
printf ("make-dns-cert gnupg-svn%s\n", "$Revision$");
#endif
return 0; return 0;
} }
else if(argc>1 && strcmp(argv[1],"--help")==0) else if(argc>1 && strcmp(argv[1],"--help")==0)