* undelfs.c (undelfs_open): Use g_try_malloc() instead
of g_malloc(). * smbfs.c (smbfs_send): Don't account negative "ret".
Этот коммит содержится в:
родитель
959955939d
Коммит
e4d7245a11
@ -1,3 +1,10 @@
|
||||
2004-10-17 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||
|
||||
* undelfs.c (undelfs_open): Use g_try_malloc() instead
|
||||
of g_malloc().
|
||||
|
||||
* smbfs.c (smbfs_send): Don't account negative "ret".
|
||||
|
||||
2004-10-16 Roland Illig <roland.illig@gmx.de>
|
||||
|
||||
* tar.c (tar_read_header): Fixed handling of filenames starting
|
||||
|
@ -602,9 +602,11 @@ smbfs_send(struct cli_state *cli)
|
||||
|
||||
while (nwritten < len) {
|
||||
ret = write_socket(cli->fd, cli->outbuf+nwritten, len - nwritten);
|
||||
if (ret <= 0 && errno == EPIPE)
|
||||
if (ret <= 0) {
|
||||
if (errno == EPIPE)
|
||||
return False;
|
||||
nwritten += ret;
|
||||
} else
|
||||
nwritten += ret;
|
||||
}
|
||||
|
||||
return True;
|
||||
|
@ -423,13 +423,13 @@ undelfs_open (struct vfs_class *me, const char *fname, int flags, int mode)
|
||||
continue;
|
||||
|
||||
/* Found: setup all the structures needed by read */
|
||||
p = g_new (undelfs_file, 1);
|
||||
p = (undelfs_file *) g_try_malloc (((gsize) sizeof (undelfs_file)));
|
||||
if (!p) {
|
||||
g_free (file);
|
||||
g_free (f);
|
||||
return 0;
|
||||
}
|
||||
p->buf = g_malloc (fs->blocksize);
|
||||
p->buf = g_try_malloc (fs->blocksize);
|
||||
if (!p->buf) {
|
||||
g_free (p);
|
||||
g_free (file);
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user