mirror of
https://github.com/owntracks/recorder.git
synced 2026-08-23 11:26:16 +00:00
move is_directory() to utils
This commit is contained in:
@@ -1,19 +1,9 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdlib.h>
|
||||
#include "gcache.h"
|
||||
|
||||
static int is_directory(char *path)
|
||||
{
|
||||
struct stat sb;
|
||||
|
||||
if (stat(path, &sb) != 0)
|
||||
return (0);
|
||||
return (S_ISDIR(sb.st_mode));
|
||||
}
|
||||
#include "util.h"
|
||||
|
||||
struct gcache *gcache_open(char *path, int rdonly)
|
||||
{
|
||||
|
||||
@@ -3,11 +3,23 @@
|
||||
#include <string.h>
|
||||
#include <syslog.h>
|
||||
#include "util.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifndef LINESIZE
|
||||
# define LINESIZE 8192
|
||||
#endif
|
||||
|
||||
int is_directory(char *path)
|
||||
{
|
||||
struct stat sb;
|
||||
|
||||
if (stat(path, &sb) != 0)
|
||||
return (0);
|
||||
return (S_ISDIR(sb.st_mode));
|
||||
}
|
||||
|
||||
const char *isotime(time_t t) {
|
||||
static char buf[] = "YYYY-MM-DDTHH:MM:SSZ";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user