summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2008-03-26 18:44:56 +0100
committerWerner Koch <wk@gnupg.org>2008-03-26 18:44:56 +0100
commitdc2de957b3f0c0db27cf8dc1b640cdad00e8fd6c (patch)
tree30795f4fdd85cf75f75abbd271c70462806a861a /tools
parentUpdate (diff)
downloadgnupg2-dc2de957b3f0c0db27cf8dc1b640cdad00e8fd6c.tar.xz
gnupg2-dc2de957b3f0c0db27cf8dc1b640cdad00e8fd6c.zip
Allow standalone build.
Diffstat (limited to 'tools')
-rw-r--r--tools/ChangeLog6
-rw-r--r--tools/make-dns-cert.c18
2 files changed, 20 insertions, 4 deletions
diff --git a/tools/ChangeLog b/tools/ChangeLog
index 7d4e96390..88660a555 100644
--- a/tools/ChangeLog
+++ b/tools/ChangeLog
@@ -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>
* gpg-connect-agent.c (arithmetic_op): Add logical not, or and and.
diff --git a/tools/make-dns-cert.c b/tools/make-dns-cert.c
index 31314edc9..42b76c6fd 100644
--- a/tools/make-dns-cert.c
+++ b/tools/make-dns-cert.c
@@ -1,5 +1,5 @@
/* 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.
*
@@ -17,7 +17,10 @@
* 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>
#ifdef HAVE_GETOPT_H
#include <getopt.h>
@@ -26,6 +29,7 @@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
+#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -72,7 +76,9 @@ cert_key(const char *name,const char *keyfile)
{
unsigned char buffer[1024];
- err=read(fd,buffer,1024);
+ do
+ err = read (fd,buffer,1024);
+ while (err == -1 && errno == EINTR);
if(err==-1)
{
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)
{
- 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;
}
else if(argc>1 && strcmp(argv[1],"--help")==0)