summaryrefslogtreecommitdiffstats
path: root/source4/lib/json/test1.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-13 22:46:23 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:50:00 +0100
commit61873ce94c172c801a4831de5550a8e0fe54c5f5 (patch)
tree1adef0ad4078d98bd8529be8219af84938886f65 /source4/lib/json/test1.c
parenta2cea02584256e2cf59da5420e8e080e70c66939 (diff)
downloadsamba-61873ce94c172c801a4831de5550a8e0fe54c5f5.tar.gz
samba-61873ce94c172c801a4831de5550a8e0fe54c5f5.tar.xz
samba-61873ce94c172c801a4831de5550a8e0fe54c5f5.zip
r26431: Require ndr_push creators to specify a iconv_convenience context.
(This used to be commit 7352206f4450fdf881b95bda064cedd9d2477e4c)
Diffstat (limited to 'source4/lib/json/test1.c')
0 files changed, 0 insertions, 0 deletions
> 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <setjmp.h>
#include <ctype.h>
#include <stdarg.h>

struct glibc_stat {
    long long st_dev;
    unsigned short int __pad1;
    long st_ino;
    int st_mode;
    int st_nlink;
    int  st_uid;
    int  st_gid;
    long long st_rdev;
    unsigned short int __pad2;
    long st_size;
    long st_blksize;
    long st_blocks;
    long st_atime;
    unsigned long int __unused1;
    long st_mtime;
    unsigned long int __unused2;
    long st_ctime;
    unsigned long int __unused3;
    unsigned long int __unused4;
    unsigned long int __unused5;
};

static void stat_copy(struct stat * from, struct glibc_stat * to) {
    to->st_dev = from->st_dev;
    to->st_ino = from->st_ino;
    to->st_mode = from->st_mode;
    to->st_nlink = from->st_nlink;
    to->st_uid = from->st_uid;
    to->st_gid = from->st_gid;
    to->st_rdev = from->st_rdev;
    to->st_size = from->st_size;
    to->st_blksize = from->st_blksize;
    to->st_blocks = from->st_blocks;
    to->st_atime = from->st_atime;
    to->st_mtime = from->st_mtime;
    to->st_ctime = from->st_ctime;
}

int __xstat (int __ver, __const char *__filename, struct glibc_stat * sb) {
    struct stat s;
    int rc = stat(__filename, &s); 

    if (!rc) stat_copy(&s, sb);

    return rc;
}