]> git.donarmstrong.com Git - lilypond.git/blobdiff - ttftool/util.c
* lily/pfb.cc (LY_DEFINE): set ttf_verbosity from ttf-verbosity
[lilypond.git] / ttftool / util.c
index fa6e7b3add7e0311ea7bd083af5fb37e455be80b..aedbd43a239b83412bf0f1c23e6006074a067226 100644 (file)
@@ -9,9 +9,8 @@
 
 #include "types.h"
 #include "proto.h"
-
 #include "libc-extension.hh"
-
+#include "ttftool.h"
 
 
 void *
@@ -75,12 +74,16 @@ surely_lseek (int fildes, off_t offset, int whence)
 ssize_t
 surely_read (int fildes, void *buf, size_t nbyte)
 {
+  if (ttf_verbosity >= 3)
+    fprintf (stderr, "Reading %d bytes\n", nbyte);
+  
   ssize_t n;
   if ((n = read (fildes, buf, nbyte)) < nbyte)
     {
       char s[100];
       sprintf (s, "read too little in surely_read(), expect %d got %d", nbyte, n);
-      syserror  (s);
+      sprintf (s, "trying again yields %d", read (fildes, buf, nbyte - n));
+      syserror (s);
     }
   return n;
 }