*/
#include "includes.h"
+#include "../libgpo/gpo.h"
+#include "libgpo/gpo_proto.h"
struct sync_context {
TALLOC_CTX *mem_ctx;
const char *unix_path)
{
NTSTATUS result;
- int fnum;
- int fd = 0;
+ uint16_t fnum;
+ int fd = -1;
char *data = NULL;
static int io_bufsize = 64512;
int read_size = io_bufsize;
off_t nread = 0;
- if ((fnum = cli_open(cli, nt_path, O_RDONLY, DENY_NONE)) == -1) {
- result = NT_STATUS_NO_SUCH_FILE;
+ result = cli_open(cli, nt_path, O_RDONLY, DENY_NONE, &fnum);
+ if (!NT_STATUS_IS_OK(result)) {
goto out;
}
if (fnum) {
cli_close(cli, fnum);
}
- if (fd) {
+ if (fd != -1) {
close(fd);
}
ctx) == -1) {
DEBUG(1,("listing [%s] failed with error: %s\n",
ctx->mask, cli_errstr(ctx->cli)));
- return False;
+ return false;
}
- return True;
+ return true;
}
/****************************************************************