Skip to content

Commit

Permalink
code refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
hariharan-devarajan committed Oct 9, 2023
1 parent 855a5ef commit 556621d
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,6 @@ jobs:
total_lines=`cat $PWD/output/.trace*.pfw | wc -l`
echo $num_posix_lines of $total_lines
rm -rf $PWD/output
if [[ "$num_posix_lines" -ne "641" ]]; then
if [[ "$num_posix_lines" -ne "640" ]]; then
exit 1
fi
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
39 changes: 0 additions & 39 deletions src/dlio_profiler/writer/base_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,6 @@ namespace dlio_profiler {
protected:
bool throw_error;
std::string filename;
int dlp_open(const char *pathname, int flags, ...) {
mode_t mode;
va_list args;
long result;

va_start(args, flags);
if (flags & O_CREAT) {
mode = va_arg(args, mode_t);
}
else {
mode = 0;
}
va_end(args);
#if defined(SYS_open)
result = syscall(SYS_open, pathname, flags, mode);
#else
result = syscall(SYS_openat, AT_FDCWD, pathname, flags, mode);
#endif

if (result >= 0)
return (int) result;
return -1;
}

ssize_t dlp_write(int fd, const void *buf, size_t count) {
return syscall(SYS_write, fd, buf, count);
}

ssize_t dlp_read(int fd, void *buf, size_t count) {
return syscall(SYS_read, fd, buf, count);
}

int dlp_close(int fd) {
return syscall(SYS_close, fd);
}

int dlp_fsync(int fd) {
return syscall(SYS_fsync, fd);
}
public:
virtual void initialize(char *filename, bool throw_error) = 0;

Expand Down

0 comments on commit 556621d

Please sign in to comment.