mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-05 03:20:46 -05:00
Implement strerror
This commit is contained in:
@@ -36,25 +36,10 @@
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "private/ErrnoRestorer.h"
|
||||
|
||||
extern "C" int sys_getdents64(unsigned int, dirent*, unsigned int);
|
||||
|
||||
class ErrnoRestorer {
|
||||
public:
|
||||
explicit ErrnoRestorer() : saved_errno_(errno) {
|
||||
}
|
||||
|
||||
~ErrnoRestorer() {
|
||||
errno = saved_errno_;
|
||||
}
|
||||
|
||||
void override(int new_errno) {
|
||||
saved_errno_ = new_errno;
|
||||
}
|
||||
|
||||
private:
|
||||
int saved_errno_;
|
||||
};
|
||||
|
||||
// Apportable decided to copy the data structure from this file
|
||||
// and use it in their own code, but they also call into readdir.
|
||||
// In order to avoid a lockup, the structure must be maintained in
|
||||
|
||||
Reference in New Issue
Block a user