Skip to content

Commit

Permalink
util: Fix definition of static functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
heinezen committed Nov 18, 2024
1 parent 19557aa commit 3d6a3ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions libopenage/util/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

#include "util/filelike/native.h"
#include "util/filelike/python.h"
#include "util/fslike/directory.h"
#include "util/path.h"
#include "util/strings.h"
#include "util/fslike/directory.h"


namespace openage::util {
Expand Down Expand Up @@ -122,13 +122,12 @@ std::ostream &operator<<(std::ostream &stream, const File &file) {
return stream;
}

static File get_temp_file() {
File File::get_temp_file() {
fslike::Directory temp_dir = fslike::Directory::get_temp_directory();
std::string file_name = std::tmpnam(nullptr);
std::ostringstream dir_path;
temp_dir.repr(dir_path);
mode_t mode = 0777;
File file_wrapper = File(dir_path.str() + file_name, mode);
File file_wrapper = File(dir_path.str() + file_name, 0777);
return file_wrapper;
}

Expand Down
4 changes: 2 additions & 2 deletions libopenage/util/fslike/directory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include <cstdio>
#include <dirent.h>
#include <fcntl.h>
#include <iostream>
#include <filesystem>
#include <iostream>
#include <sys/stat.h>
#include <sys/types.h>
#include <utility>
Expand Down Expand Up @@ -293,7 +293,7 @@ std::ostream &Directory::repr(std::ostream &stream) {
return stream;
}

static Directory get_temp_directory() {
Directory Directory::get_temp_directory() {
std::string temp_dir_path = std::filesystem::temp_directory_path() / std::tmpnam(nullptr);
bool create = true;
Directory directory = Directory(temp_dir_path, create);
Expand Down

0 comments on commit 3d6a3ac

Please sign in to comment.