Commit a5b57ccf597d48e3077d7bbb628bbdaa75af6f27

Stefan Sperling 2019-04-11T13:37:50

omit unused mode argument to open(2)

diff --git a/lib/object.c b/lib/object.c
index 8abd471..0c85256 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -143,7 +143,7 @@ open_loose_object(int *fd, struct got_object_id *id,
 	err = object_path(&path, id, repo);
 	if (err)
 		return err;
-	*fd = open(path, O_RDONLY | O_NOFOLLOW, GOT_DEFAULT_FILE_MODE);
+	*fd = open(path, O_RDONLY | O_NOFOLLOW);
 	if (*fd == -1) {
 		err = got_error_from_errno();
 		goto done;
@@ -422,7 +422,7 @@ got_object_open(struct got_object **obj, struct got_repository *repo,
 	if (err)
 		return err;
 
-	fd = open(path, O_RDONLY | O_NOFOLLOW, GOT_DEFAULT_FILE_MODE);
+	fd = open(path, O_RDONLY | O_NOFOLLOW);
 	if (fd == -1) {
 		if (errno == ENOENT)
 			err = got_error_no_obj(id);
diff --git a/lib/pack.c b/lib/pack.c
index 92c3db0..94d6d9c 100644
--- a/lib/pack.c
+++ b/lib/pack.c
@@ -369,7 +369,7 @@ got_packidx_open(struct got_packidx **packidx, const char *path, int verify)
 	if (p == NULL)
 		return got_error_from_errno();
 
-	p->fd = open(path, O_RDONLY | O_NOFOLLOW, GOT_DEFAULT_FILE_MODE);
+	p->fd = open(path, O_RDONLY | O_NOFOLLOW);
 	if (p->fd == -1)
 		return got_error_from_errno();
 
diff --git a/lib/repository.c b/lib/repository.c
index fac0482..ad65519 100644
--- a/lib/repository.c
+++ b/lib/repository.c
@@ -700,7 +700,7 @@ open_packfile(int *fd, const char *path_packfile, struct got_packidx *packidx)
 {
 	const struct got_error *err = NULL;
 
-	*fd = open(path_packfile, O_RDONLY | O_NOFOLLOW, GOT_DEFAULT_FILE_MODE);
+	*fd = open(path_packfile, O_RDONLY | O_NOFOLLOW);
 	if (*fd == -1)
 		return got_error_from_errno();