Use gpg_err_set_errno to assign values to ERRNO.
[gnupg.git] / g10 / exec.c
index 6ab2479..8f26eda 100644 (file)
@@ -449,8 +449,8 @@ exec_write(struct exec_info **info,const char *program,
          goto fail;
        }
 
-      /* fd iobufs are cached?! */
-      iobuf_ioctl((*info)->fromchild,3,1,NULL);
+      /* fd iobufs are cached! */
+      iobuf_ioctl((*info)->fromchild, IOBUF_IOCTL_NO_CACHE, 1, NULL);
 
       return 0;
     }
@@ -463,7 +463,7 @@ exec_write(struct exec_info **info,const char *program,
   if( is_secured_filename ((*info)->tempfile_in) )
     {
       (*info)->tochild = NULL;
-      errno = EPERM;
+      gpg_err_set_errno (EPERM);
     }
   else
     (*info)->tochild=fopen((*info)->tempfile_in,binary?"wb":"w");
@@ -545,7 +545,7 @@ exec_read(struct exec_info *info)
             {
               iobuf_close (info->fromchild);
               info->fromchild = NULL;
-              errno = EPERM;
+              gpg_err_set_errno (EPERM);
             }
          if(info->fromchild==NULL)
            {
@@ -556,7 +556,7 @@ exec_read(struct exec_info *info)
            }
 
          /* Do not cache this iobuf on close */
-         iobuf_ioctl(info->fromchild,3,1,NULL);
+         iobuf_ioctl(info->fromchild, IOBUF_IOCTL_NO_CACHE, 1, NULL);
        }
     }