-static void
-usage (progname)
- const char *progname;
-{
- printf ("%s (%s) %s\n"
- "Copyright (C) 1999 Free Software Foundation, Inc.\n"
- "This program comes with ABSOLUTELY NO WARRANTY.\n"
- "This is free software, and you are welcome to redistribute it\n"
- "under certain conditions. See the file COPYING for details.\n\n"
- "Usage: %s [options] host port\n\n"
- "Options:\n\n"
- " --cert-file [file] specify certificate file\n"
- " --key-file [file] specify private key file\n"
- " --verify [level] set verification level\n",
- progname, PACKAGE, VERSION, progname);
+ writefds[0].fd = fd;
+ writefds[0].events = POLLOUT;
+
+ for (retry = buffer; nbuffer > 0; nbuffer -= wrote, retry += wrote)
+ {
+ int ready;
+
+ sigprocmask (SIG_SETMASK, &mask, &orig_mask);
+ ready = poll (writefds, 1, -1);
+ sigprocmask (SIG_SETMASK, &orig_mask, NULL);
+ if (ready == -1 && errno != EINTR)
+ {
+ if (opt_assuan)
+ printf ("ERR 1 poll: %s\r\n", strerror (errno));
+ return 1;
+ }
+ wrote = (*write_function)(fd, retry, nbuffer);
+ if (wrote == -1)
+ {
+ if (opt_assuan)
+ printf ("ERR 1 write: %s\r\n", strerror (errno));
+ return 1;
+ }
+ }