Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- fix gzdopen() call, it does not like mode "r+"

  • Loading branch information...
commit d5fa51ce3c47054221b34490497cd9f3ab25fa45 1 parent 6f99eb3
@mlschroe mlschroe authored
Showing with 8 additions and 3 deletions.
  1. +1 −1  examples/pysolv
  2. +1 −1  examples/solv.c
  3. +6 −1 ext/sat_xfopen.c
View
2  examples/pysolv
@@ -495,7 +495,7 @@ class repo_susetags(repo_generic):
di = self.handle.Dataiterator(solv.SOLVID_META, solv.SUSETAGS_FILE_NAME, None, 0)
di.prepend_keyname(solv.SUSETAGS_FILE)
for d in di:
- filename = d.str
+ filename = d.str()
if not filename:
continue
if filename[0:9] != "packages.":
View
2  examples/solv.c
@@ -850,7 +850,7 @@ curlfopen(struct repoinfo *cinfo, const char *file, int uncompress, const unsign
return 0;
}
if (uncompress)
- return sat_xfopen_fd(".gz", fd, 0);
+ return sat_xfopen_fd(".gz", fd, "r");
fcntl(fd, F_SETFD, FD_CLOEXEC);
return fdopen(fd, "r");
}
View
7 ext/sat_xfopen.c
@@ -80,7 +80,12 @@ sat_xfopen_fd(const char *fn, int fd, const char *mode)
if (fl == O_WRONLY)
mode = "w";
else if (fl == O_RDWR)
- mode = "r+";
+ {
+ if (!suf || strcmp(suf, ".gz") != 0)
+ mode = "r+";
+ else
+ mode = "r";
+ }
else
mode = "r";
}
Please sign in to comment.
Something went wrong with that request. Please try again.