Skip to content

Commit

Permalink
Merge pull request #289 from Wolf3s/Cleanups
Browse files Browse the repository at this point in the history
Code cleanup
  • Loading branch information
sahlberg authored Nov 25, 2023
2 parents e8fd667 + f5235f0 commit 832835f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/dcerpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1761,7 +1761,7 @@ dcerpc_get_error(struct dcerpc_context *dce)
void
dcerpc_free_data(struct dcerpc_context *dce, void *data)
{
return smb2_free_data(dcerpc_get_smb2_context(dce), data);
smb2_free_data(dcerpc_get_smb2_context(dce), data);
}

int
Expand Down
11 changes: 4 additions & 7 deletions lib/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
#include <stdarg.h>
#include <stdio.h>

#if !defined(PS2_IOP_PLATFORM)
#ifdef HAVE_TIME_H
#include <time.h>
#endif

Expand Down Expand Up @@ -473,7 +473,7 @@ void smb2_set_security_mode(struct smb2_context *smb2, uint16_t security_mode)
smb2->security_mode = security_mode;
}

#if !defined(PS2_IOP_PLATFORM)
#ifndef PS2_IOP_PLATFORM
static void smb2_set_password_from_file(struct smb2_context *smb2)
{
char *name = NULL;
Expand Down Expand Up @@ -549,11 +549,6 @@ static void smb2_set_password_from_file(struct smb2_context *smb2)
}
fclose(fh);
}
#else /* !PS2_IOP_PLATFORM */
static void smb2_set_password_from_file(struct smb2_context *smb2)
{
return;
}
#endif /* !PS2_IOP_PLATFORM */

void smb2_set_user(struct smb2_context *smb2, const char *user)
Expand All @@ -566,7 +561,9 @@ void smb2_set_user(struct smb2_context *smb2, const char *user)
return;
}
smb2->user = strdup(user);
#if !defined(PS2_IOP_PLATFORM)
smb2_set_password_from_file(smb2);
#endif
}

void smb2_set_password(struct smb2_context *smb2, const char *password)
Expand Down
4 changes: 2 additions & 2 deletions lib/libsmb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
#include <time.h>
#endif

#if defined(HAVE_FCNTL_H)
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif

Expand Down Expand Up @@ -2337,7 +2337,7 @@ smb2_ftruncate_async(struct smb2_context *smb2, struct smb2fh *fh,
{
struct create_cb_data *create_data;
struct smb2_set_info_request req;
struct smb2_file_end_of_file_info eofi;
struct smb2_file_end_of_file_info eofi _U_;
struct smb2_pdu *pdu;

if (smb2 == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion lib/sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

#include <errno.h>

#if defined(HAVE_SYS_POLL_H)
#ifdef HAVE_SYS_POLL_H
#include <sys/poll.h>
#endif

Expand Down

0 comments on commit 832835f

Please sign in to comment.