Skip to content

Commit

Permalink
build: Remove SMB_STRUCT_DIRENT define
Browse files Browse the repository at this point in the history
  • Loading branch information
abartlet committed Apr 5, 2012
1 parent 6edd8e9 commit 2320b21
Show file tree
Hide file tree
Showing 22 changed files with 54 additions and 62 deletions.
2 changes: 1 addition & 1 deletion examples/VFS/skel_opaque.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static SMB_STRUCT_DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *f
return NULL;
}

static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle,
static struct dirent *skel_readdir(vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{
Expand Down
2 changes: 1 addition & 1 deletion examples/VFS/skel_transparent.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static SMB_STRUCT_DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *f
return SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr);
}

static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle,
static struct dirent *skel_readdir(vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{
Expand Down
2 changes: 1 addition & 1 deletion libgpo/gpext/gpext.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ static NTSTATUS gp_glob_ext_list(TALLOC_CTX *mem_ctx,
size_t *ext_list_len)
{
SMB_STRUCT_DIR *dir = NULL;
SMB_STRUCT_DIRENT *dirent = NULL;
struct dirent *dirent = NULL;

dir = opendir(modules_path(talloc_tos(),
SAMBA_SUBSYSTEM_GPEXT));
Expand Down
8 changes: 0 additions & 8 deletions source3/include/includes.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,6 @@ struct stat_ex {

typedef struct stat_ex SMB_STRUCT_STAT;

/*
* Type for dirent structure.
*/

#ifndef SMB_STRUCT_DIRENT
# define SMB_STRUCT_DIRENT struct dirent
#endif

/*
* Type for DIR structure.
*/
Expand Down
4 changes: 2 additions & 2 deletions source3/include/vfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ struct vfs_fn_pointers {

SMB_STRUCT_DIR *(*opendir_fn)(struct vfs_handle_struct *handle, const char *fname, const char *mask, uint32 attributes);
SMB_STRUCT_DIR *(*fdopendir_fn)(struct vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32 attributes);
SMB_STRUCT_DIRENT *(*readdir_fn)(struct vfs_handle_struct *handle,
struct dirent *(*readdir_fn)(struct vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp,
SMB_STRUCT_STAT *sbuf);
void (*seekdir_fn)(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp, long offset);
Expand Down Expand Up @@ -560,7 +560,7 @@ SMB_STRUCT_DIR *smb_vfs_call_fdopendir(struct vfs_handle_struct *handle,
struct files_struct *fsp,
const char *mask,
uint32 attributes);
SMB_STRUCT_DIRENT *smb_vfs_call_readdir(struct vfs_handle_struct *handle,
struct dirent *smb_vfs_call_readdir(struct vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp,
SMB_STRUCT_STAT *sbuf);
void smb_vfs_call_seekdir(struct vfs_handle_struct *handle,
Expand Down
4 changes: 2 additions & 2 deletions source3/lib/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1031,13 +1031,13 @@ void log_stack_trace(void)

const char *readdirname(SMB_STRUCT_DIR *p)
{
SMB_STRUCT_DIRENT *ptr;
struct dirent *ptr;
char *dname;

if (!p)
return(NULL);

ptr = (SMB_STRUCT_DIRENT *)readdir(p);
ptr = (struct dirent *)readdir(p);
if (!ptr)
return(NULL);

Expand Down
2 changes: 1 addition & 1 deletion source3/modules/onefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ SMB_STRUCT_DIR *onefs_opendir(struct vfs_handle_struct *handle,
const char *fname, const char *mask,
uint32 attributes);

SMB_STRUCT_DIRENT *onefs_readdir(struct vfs_handle_struct *handle,
struct dirent *onefs_readdir(struct vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp, SMB_STRUCT_STAT *sbuf);

void onefs_seekdir(struct vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp,
Expand Down
8 changes: 4 additions & 4 deletions source3/modules/onefs_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,12 @@ onefs_opendir(vfs_handle_struct *handle, const char *fname, const char *mask,
*
* @return dirent structure, NULL if at the end of the directory, NULL on error
*/
SMB_STRUCT_DIRENT *
struct dirent *
onefs_readdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{
struct rdp_dir_state *dsp = NULL;
SMB_STRUCT_DIRENT *ret_direntp;
struct dirent *ret_direntp;
bool same_as_last, filled_cache = false;
int ret = -1;

Expand Down Expand Up @@ -355,7 +355,7 @@ onefs_readdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp,
* our cursor, then return the next entry */
if (!filled_cache) {
dsp->direntries_cursor +=
((SMB_STRUCT_DIRENT *)dsp->direntries_cursor)->d_reclen;
((struct dirent *)dsp->direntries_cursor)->d_reclen;
dsp->stat_cursor++;
}

Expand All @@ -366,7 +366,7 @@ onefs_readdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp,
dsp->resume_cookie = rdp_cookies[dsp->stat_cursor];

/* Return an entry from cache */
ret_direntp = ((SMB_STRUCT_DIRENT *)dsp->direntries_cursor);
ret_direntp = ((struct dirent *)dsp->direntries_cursor);
if (sbuf) {
struct stat onefs_sbuf;

Expand Down
2 changes: 1 addition & 1 deletion source3/modules/onefs_streams.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ static NTSTATUS walk_onefs_streams(connection_struct *conn, files_struct *fsp,
int stream_fd = -1;
int ret;
SMB_STRUCT_DIR *dirp = NULL;
SMB_STRUCT_DIRENT *dp = NULL;
struct dirent *dp = NULL;
files_struct fake_fs;
struct fd_handle fake_fh;
SMB_STRUCT_STAT stream_sbuf;
Expand Down
12 changes: 6 additions & 6 deletions source3/modules/vfs_cap.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ static SMB_STRUCT_DIR *cap_opendir(vfs_handle_struct *handle, const char *fname,
return SMB_VFS_NEXT_OPENDIR(handle, capname, mask, attr);
}

static SMB_STRUCT_DIRENT *cap_readdir(vfs_handle_struct *handle,
static struct dirent *cap_readdir(vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{
SMB_STRUCT_DIRENT *result;
SMB_STRUCT_DIRENT *newdirent;
struct dirent *result;
struct dirent *newdirent;
char *newname;
size_t newnamelen;
DEBUG(3,("cap: cap_readdir\n"));
Expand All @@ -75,14 +75,14 @@ static SMB_STRUCT_DIRENT *cap_readdir(vfs_handle_struct *handle,
}
DEBUG(3,("cap: cap_readdir: %s\n", newname));
newnamelen = strlen(newname)+1;
newdirent = (SMB_STRUCT_DIRENT *)talloc_array(talloc_tos(),
newdirent = (struct dirent *)talloc_array(talloc_tos(),
char,
sizeof(SMB_STRUCT_DIRENT)+
sizeof(struct dirent)+
newnamelen);
if (!newdirent) {
return NULL;
}
memcpy(newdirent, result, sizeof(SMB_STRUCT_DIRENT));
memcpy(newdirent, result, sizeof(struct dirent));
memcpy(&newdirent->d_name, newname, newnamelen);
return newdirent;
}
Expand Down
4 changes: 2 additions & 2 deletions source3/modules/vfs_default.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,11 @@ static SMB_STRUCT_DIR *vfswrap_fdopendir(vfs_handle_struct *handle,
}


static SMB_STRUCT_DIRENT *vfswrap_readdir(vfs_handle_struct *handle,
static struct dirent *vfswrap_readdir(vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{
SMB_STRUCT_DIRENT *result;
struct dirent *result;

START_PROFILE(syscall_readdir);
result = readdir(dirp);
Expand Down
12 changes: 6 additions & 6 deletions source3/modules/vfs_dirsort.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
#include "smbd/smbd.h"
#include "system/filesys.h"

static int compare_dirent (const SMB_STRUCT_DIRENT *da, const SMB_STRUCT_DIRENT *db)
static int compare_dirent (const struct dirent *da, const struct dirent *db)
{
return strcasecmp_m(da->d_name, db->d_name);
}

struct dirsort_privates {
long pos;
SMB_STRUCT_DIRENT *directory_list;
struct dirent *directory_list;
long number_of_entries;
time_t mtime;
SMB_STRUCT_DIR *source_directory;
Expand All @@ -47,7 +47,7 @@ static void free_dirsort_privates(void **datap) {

static bool open_and_sort_dir (vfs_handle_struct *handle)
{
SMB_STRUCT_DIRENT *dp;
struct dirent *dp;
struct stat dir_stat;
long current_pos;
struct dirsort_privates *data = NULL;
Expand All @@ -72,8 +72,8 @@ static bool open_and_sort_dir (vfs_handle_struct *handle)

/* Set up an array and read the directory entries into it */
SAFE_FREE(data->directory_list); /* destroy previous cache if needed */
data->directory_list = (SMB_STRUCT_DIRENT *)SMB_MALLOC(
data->number_of_entries * sizeof(SMB_STRUCT_DIRENT));
data->directory_list = (struct dirent *)SMB_MALLOC(
data->number_of_entries * sizeof(struct dirent));
if (!data->directory_list) {
return false;
}
Expand Down Expand Up @@ -166,7 +166,7 @@ static SMB_STRUCT_DIR *dirsort_fdopendir(vfs_handle_struct *handle,
return data->source_directory;
}

static SMB_STRUCT_DIRENT *dirsort_readdir(vfs_handle_struct *handle,
static struct dirent *dirsort_readdir(vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{
Expand Down
4 changes: 2 additions & 2 deletions source3/modules/vfs_full_audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,10 +760,10 @@ static SMB_STRUCT_DIR *smb_full_audit_fdopendir(vfs_handle_struct *handle,
return result;
}

static SMB_STRUCT_DIRENT *smb_full_audit_readdir(vfs_handle_struct *handle,
static struct dirent *smb_full_audit_readdir(vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp, SMB_STRUCT_STAT *sbuf)
{
SMB_STRUCT_DIRENT *result;
struct dirent *result;

result = SMB_VFS_NEXT_READDIR(handle, dirp, sbuf);

Expand Down
2 changes: 1 addition & 1 deletion source3/modules/vfs_netatalk.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ static void atalk_add_to_list(name_compare_entry **list)
static void atalk_rrmdir(TALLOC_CTX *ctx, char *path)
{
char *dpath;
SMB_STRUCT_DIRENT *dent = 0;
struct dirent *dent = 0;
SMB_STRUCT_DIR *dir;

if (!path) return;
Expand Down
16 changes: 8 additions & 8 deletions source3/modules/vfs_scannedonly.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ static bool scannedonly_allow_access(vfs_handle_struct * handle,
/* check the rest of the directory and notify the
scanner if some file needs scanning */
long offset;
SMB_STRUCT_DIRENT *dire;
struct dirent *dire;

offset = SMB_VFS_NEXT_TELLDIR(handle, sDIR->DIR);
dire = SMB_VFS_NEXT_READDIR(handle, sDIR->DIR, NULL);
Expand Down Expand Up @@ -560,17 +560,17 @@ static SMB_STRUCT_DIR *scannedonly_fdopendir(vfs_handle_struct * handle,
}


static SMB_STRUCT_DIRENT *scannedonly_readdir(vfs_handle_struct *handle,
static struct dirent *scannedonly_readdir(vfs_handle_struct *handle,
SMB_STRUCT_DIR * dirp,
SMB_STRUCT_STAT *sbuf)
{
SMB_STRUCT_DIRENT *result;
struct dirent *result;
int allowed = 0;
char *tmp;
struct smb_filename *smb_fname;
char *notify_name;
int namelen;
SMB_STRUCT_DIRENT *newdirent;
struct dirent *newdirent;
TALLOC_CTX *ctx=talloc_tos();

struct scannedonly_DIR *sDIR = (struct scannedonly_DIR *)dirp;
Expand Down Expand Up @@ -634,12 +634,12 @@ static SMB_STRUCT_DIRENT *scannedonly_readdir(vfs_handle_struct *handle,
ctx,"%s %s",result->d_name,
STRUCTSCANO(handle->data)->scanning_message);
namelen = strlen(notify_name);
newdirent = (SMB_STRUCT_DIRENT *)talloc_array(
ctx, char, sizeof(SMB_STRUCT_DIRENT) + namelen + 1);
newdirent = (struct dirent *)talloc_array(
ctx, char, sizeof(struct dirent) + namelen + 1);
if (!newdirent) {
return NULL;
}
memcpy(newdirent, result, sizeof(SMB_STRUCT_DIRENT));
memcpy(newdirent, result, sizeof(struct dirent));
memcpy(&newdirent->d_name, notify_name, namelen + 1);
DEBUG(SCANNEDONLY_DEBUG,
("scannedonly_readdir, return newdirent at %p with "
Expand Down Expand Up @@ -860,7 +860,7 @@ static int scannedonly_rmdir(vfs_handle_struct * handle, const char *path)
/* if there are only .scanned: .virus: or .failed: files, we delete
those, because the client cannot see them */
DIR *dirp;
SMB_STRUCT_DIRENT *dire;
struct dirent *dire;
TALLOC_CTX *ctx = talloc_tos();
bool only_deletable_files = true, have_files = false;
char *path_w_slash;
Expand Down
14 changes: 7 additions & 7 deletions source3/modules/vfs_shadow_copy.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static int vfs_shadow_copy_debug_level = DBGC_VFS;
typedef struct {
int pos;
int num;
SMB_STRUCT_DIRENT *dirs;
struct dirent *dirs;
} shadow_copy_Dir;

static bool shadow_copy_match_name(const char *name)
Expand Down Expand Up @@ -93,7 +93,7 @@ static SMB_STRUCT_DIR *shadow_copy_opendir(vfs_handle_struct *handle, const char
ZERO_STRUCTP(dirp);

while (True) {
SMB_STRUCT_DIRENT *d;
struct dirent *d;

d = SMB_VFS_NEXT_READDIR(handle, p, NULL);
if (d == NULL) {
Expand All @@ -107,7 +107,7 @@ static SMB_STRUCT_DIR *shadow_copy_opendir(vfs_handle_struct *handle, const char

DEBUG(10,("shadow_copy_opendir: not hide [%s]\n",d->d_name));

dirp->dirs = SMB_REALLOC_ARRAY(dirp->dirs,SMB_STRUCT_DIRENT, dirp->num+1);
dirp->dirs = SMB_REALLOC_ARRAY(dirp->dirs,struct dirent, dirp->num+1);
if (!dirp->dirs) {
DEBUG(0,("shadow_copy_opendir: Out of memory\n"));
break;
Expand Down Expand Up @@ -143,7 +143,7 @@ static SMB_STRUCT_DIR *shadow_copy_fdopendir(vfs_handle_struct *handle, files_st
ZERO_STRUCTP(dirp);

while (True) {
SMB_STRUCT_DIRENT *d;
struct dirent *d;

d = SMB_VFS_NEXT_READDIR(handle, p, NULL);
if (d == NULL) {
Expand All @@ -157,7 +157,7 @@ static SMB_STRUCT_DIR *shadow_copy_fdopendir(vfs_handle_struct *handle, files_st

DEBUG(10,("shadow_copy_fdopendir: not hide [%s]\n",d->d_name));

dirp->dirs = SMB_REALLOC_ARRAY(dirp->dirs,SMB_STRUCT_DIRENT, dirp->num+1);
dirp->dirs = SMB_REALLOC_ARRAY(dirp->dirs,struct dirent, dirp->num+1);
if (!dirp->dirs) {
DEBUG(0,("shadow_copy_fdopendir: Out of memory\n"));
break;
Expand All @@ -172,7 +172,7 @@ static SMB_STRUCT_DIR *shadow_copy_fdopendir(vfs_handle_struct *handle, files_st
return((SMB_STRUCT_DIR *)dirp);
}

static SMB_STRUCT_DIRENT *shadow_copy_readdir(vfs_handle_struct *handle,
static struct dirent *shadow_copy_readdir(vfs_handle_struct *handle,
SMB_STRUCT_DIR *_dirp,
SMB_STRUCT_STAT *sbuf)
{
Expand Down Expand Up @@ -233,7 +233,7 @@ static int shadow_copy_get_shadow_copy_data(vfs_handle_struct *handle,

while (True) {
SHADOW_COPY_LABEL *tlabels;
SMB_STRUCT_DIRENT *d;
struct dirent *d;

d = SMB_VFS_NEXT_READDIR(handle, p, NULL);
if (d == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion source3/modules/vfs_shadow_copy2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ static int shadow_copy2_get_shadow_copy_data(
{
SMB_STRUCT_DIR *p;
const char *snapdir;
SMB_STRUCT_DIRENT *d;
struct dirent *d;
TALLOC_CTX *tmp_ctx = talloc_stackframe();

snapdir = shadow_copy2_find_snapdir(tmp_ctx, handle, fsp->fsp_name);
Expand Down
4 changes: 2 additions & 2 deletions source3/modules/vfs_time_audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,11 @@ static SMB_STRUCT_DIR *smb_time_audit_fdopendir(vfs_handle_struct *handle,
return result;
}

static SMB_STRUCT_DIRENT *smb_time_audit_readdir(vfs_handle_struct *handle,
static struct dirent *smb_time_audit_readdir(vfs_handle_struct *handle,
SMB_STRUCT_DIR *dirp,
SMB_STRUCT_STAT *sbuf)
{
SMB_STRUCT_DIRENT *result;
struct dirent *result;
struct timespec ts1,ts2;
double timediff;

Expand Down
2 changes: 1 addition & 1 deletion source3/param/loadparm.c
Original file line number Diff line number Diff line change
Expand Up @@ -8734,7 +8734,7 @@ int load_usershare_shares(struct smbd_server_connection *sconn,
{
SMB_STRUCT_DIR *dp;
SMB_STRUCT_STAT sbuf;
SMB_STRUCT_DIRENT *de;
struct dirent *de;
int num_usershares = 0;
int max_user_shares = Globals.iUsershareMaxShares;
unsigned int num_dir_entries, num_bad_dir_entries, num_tmp_dir_entries;
Expand Down
Loading

0 comments on commit 2320b21

Please sign in to comment.