mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 00:45:24 +00:00
implement use of _get_osfhandle
svn path=/trunk/; revision=257
This commit is contained in:
parent
2c7fb0c72e
commit
f6e36a9f86
8 changed files with 10 additions and 14 deletions
|
@ -3,8 +3,7 @@
|
|||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <libc/file.h>
|
||||
//#include <libc/local.h>
|
||||
//#include <libc/stdiohk.h>
|
||||
|
||||
|
||||
FILE * __alloc_file(void);
|
||||
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
|
||||
//#include <libc/stubs.h>
|
||||
#include <stdio.h>
|
||||
#include <io.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <stdlib.h>
|
||||
//#include <unistd.h>
|
||||
|
||||
#include <libc/file.h>
|
||||
|
||||
#ifndef __dj_include_stdio_h_
|
||||
|
|
|
@ -35,7 +35,7 @@ fputs(const char *s, FILE *f)
|
|||
return(r);
|
||||
*/
|
||||
int r = 0;
|
||||
if ( !WriteFile(filehnd(f->_file),s,strlen(s),&r,NULL) )
|
||||
if ( !WriteFile(_get_osfhandle(f->_file),s,strlen(s),&r,NULL) )
|
||||
return -1;
|
||||
|
||||
return r;
|
||||
|
|
|
@ -8,7 +8,7 @@ int getc(FILE *f)
|
|||
{
|
||||
int c;
|
||||
DWORD NumberOfBytesRead;
|
||||
if ( !ReadFile(filehnd(f->_file),&c, 1, &NumberOfBytesRead, NULL) )
|
||||
if ( !ReadFile(_get_osfhandle(f->_file),&c, 1, &NumberOfBytesRead, NULL) )
|
||||
return -1;
|
||||
if ( NumberOfBytesRead == 0 )
|
||||
return -1;
|
||||
|
|
|
@ -21,7 +21,7 @@ int putc(int c, FILE *fp)
|
|||
}
|
||||
return(_flsbuf(c,fp));
|
||||
}
|
||||
if ( !WriteFile(filehnd(fp->_file),&c,1,&r,NULL) )
|
||||
if ( !WriteFile(_get_osfhandle(fp->_file),&c,1,&r,NULL) )
|
||||
return -1;
|
||||
return r;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ puts(const char *s)
|
|||
return putchar('\n');
|
||||
*/
|
||||
int r = 0;
|
||||
if ( !WriteFile(filehnd(stdout->_file),s,strlen(s),&r,NULL) )
|
||||
if ( !WriteFile(_get_osfhandle(stdout->_file),s,strlen(s),&r,NULL) )
|
||||
return -1;
|
||||
|
||||
return putchar('\n');;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <windows.h>
|
||||
#include <io.h>
|
||||
|
||||
int remove(const char *fn)
|
||||
{
|
||||
|
@ -6,4 +7,4 @@ int remove(const char *fn)
|
|||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,12 +2,9 @@
|
|||
#include <stdio.h>
|
||||
#include <io.h>
|
||||
|
||||
int rename(const char *old, const char *new)
|
||||
{
|
||||
return _rename(old,new);
|
||||
}
|
||||
|
||||
int _rename(const char *old, const char *new)
|
||||
|
||||
int rename(const char *old, const char *new)
|
||||
{
|
||||
if ( !MoveFile(old,new) )
|
||||
return -1;
|
||||
|
|
Loading…
Reference in a new issue