comparison gensignkey.c @ 888:6e6ae84d3dba

Fix check for EINTR
author Matt Johnston <matt@ucc.asn.au>
date Tue, 28 Jan 2014 22:44:24 +0800
parents 220f55d540ae
children fd2e8bbb0333
comparison
equal deleted inserted replaced
887:0459ff21e320 888:6e6ae84d3dba
24 24
25 /* write the file now */ 25 /* write the file now */
26 while (buf->pos != buf->len) { 26 while (buf->pos != buf->len) {
27 int len = write(fd, buf_getptr(buf, buf->len - buf->pos), 27 int len = write(fd, buf_getptr(buf, buf->len - buf->pos),
28 buf->len - buf->pos); 28 buf->len - buf->pos);
29 if (errno == EINTR) { 29 if (len == -1 && errno == EINTR) {
30 continue; 30 continue;
31 } 31 }
32 if (len <= 0) { 32 if (len <= 0) {
33 dropbear_log(LOG_ERR, "Failed writing file %s: %s", 33 dropbear_log(LOG_ERR, "Failed writing file %s: %s",
34 filename, strerror(errno)); 34 filename, strerror(errno));