diff --git a/src/mkversion.c b/src/mkversion.c
index 8913e23..8cbf890 100644
--- a/src/mkversion.c
+++ b/src/mkversion.c
@@ -10,6 +10,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#include <errno.h>

 int main(int argc, char *argv[]){
     FILE *m,*u,*v;
@@ -21,6 +22,10 @@ int main(int argc, char *argv[]){
     memset(b,0,sizeof(b));
     memset(vx,0,sizeof(vx));
     u = fopen(argv[1],"r");
+    if(!u){
+        fprintf(stderr, "can not open manifest.uuid file %s: %s!\n", argv[1], strerror(errno));
+        exit(1);
+    }
     if( fgets(b, sizeof(b)-1,u)==0 ){
       fprintf(stderr, "malformed manifest.uuid file: %s\n", argv[1]);
       exit(1);
@@ -31,6 +36,10 @@ int main(int argc, char *argv[]){
     printf("#define MANIFEST_UUID \"%s\"\n",b);
     printf("#define MANIFEST_VERSION \"[%10.10s]\"\n",b);
     m = fopen(argv[2],"r");
+    if(!m){
+        fprintf(stderr, "can not open manifest file %s: %s!\n", argv[2], strerror(errno));
+        exit(1);
+    }
     while(b ==  fgets(b, sizeof(b)-1,m)){
         if(0 == strncmp("D ",b,2)){
             printf("#define MANIFEST_DATE \"%.10s %.8s\"\n",b+2,b+13);
@@ -39,6 +48,10 @@ int main(int argc, char *argv[]){
     }
     fclose(m);
     v = fopen(argv[3],"r");
+    if(!v){
+        fprintf(stderr, "failed to open VERSION file %s: %s!\n", argv[3], strerror(errno));
+        exit(1);
+    }
     if( fgets(b, sizeof(b)-1,v)==0 ){
       fprintf(stderr, "malformed VERSION file: %s\n", argv[3]);
       exit(1);
