80e418d430
OK sthen@, ajacoutot@
50 lines
1.5 KiB
Plaintext
50 lines
1.5 KiB
Plaintext
$OpenBSD: patch-src_imlib_c,v 1.2 2010/09/13 07:24:24 dcoppa Exp $
|
|
--- src/imlib.c.orig Fri Sep 10 16:00:01 2010
|
|
+++ src/imlib.c Fri Sep 10 16:03:36 2010
|
|
@@ -435,6 +435,7 @@ char *feh_http_load_image(char *url)
|
|
close(sockno);
|
|
fclose(fp);
|
|
} else {
|
|
+ int fd;
|
|
int pid;
|
|
int status;
|
|
|
|
@@ -443,18 +444,20 @@ char *feh_http_load_image(char *url)
|
|
free(tmpname);
|
|
return(NULL);
|
|
} else if (pid == 0) {
|
|
- char *quiet = NULL;
|
|
-
|
|
- if (!opt.verbose)
|
|
- quiet = estrdup("-q");
|
|
-
|
|
- execlp("wget", "wget", "--cache=off", "-O", tmpname, url, quiet, NULL);
|
|
- eprintf("url: Is 'wget' installed? Failed to exec wget:");
|
|
+ if (!opt.verbose) {
|
|
+ if ((fd = open("/dev/null", O_WRONLY)) != -1) {
|
|
+ dup2(fd, fileno(stdout));
|
|
+ dup2(fd, fileno(stderr));
|
|
+ }
|
|
+ if (fd > 2) close(fd);
|
|
+ }
|
|
+ execlp("ftp", "ftp", "-o", tmpname, url, (char *)NULL);
|
|
+ eprintf("url: Is 'ftp' installed? Failed to exec ftp:");
|
|
} else {
|
|
waitpid(pid, &status, 0);
|
|
|
|
if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
|
|
- weprintf("url: wget failed to load URL %s\n", url);
|
|
+ weprintf("url: ftp failed to load URL %s\n", url);
|
|
unlink(tmpname);
|
|
free(tmpname);
|
|
return(NULL);
|
|
@@ -962,7 +965,7 @@ void feh_edit_inplace_lossless_rotate(winwidget w, int
|
|
} else if (pid == 0) {
|
|
|
|
execlp("jpegtran", "jpegtran", "-copy", "all", "-rotate",
|
|
- rotate_str, "-outfile", file_str, file_str, NULL);
|
|
+ rotate_str, "-outfile", file_str, file_str, (char *)NULL);
|
|
|
|
eprintf("lossless rotate: Is 'jpegtran' installed? Failed to exec:");
|
|
} else {
|