Skip to content

Commit

Permalink
fixup! feat: read snapshot from fd
Browse files Browse the repository at this point in the history
  • Loading branch information
mhofman committed Apr 28, 2023
1 parent 8f88185 commit 9e78492
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions xsnap/sources/xsnap-worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,14 +340,13 @@ int main(int argc, char* argv[])
xsInitializeSharedCluster();
if (argr) {
char *path = argv[argr];
SnapshotStream stream;
if (path[0] == '@') {
int fd = atoi(path + 1);
int tmpfd = dup(fd);
if (tmpfd < 0) {
snapshot.error = errno;
} else {
stream.file = fdopen(tmpfd, "rb");
snapshot.stream = fdopen(tmpfd, "rb");
}
} else {
snapshot.stream = fopen(path, "rb");
Expand Down

0 comments on commit 9e78492

Please sign in to comment.