mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[rosapps]
- Avoid old crt names usage, by Caemyr/kjk_hyperion. svn path=/trunk/; revision=44107
This commit is contained in:
parent
94d60cdacc
commit
effa38586c
10 changed files with 25 additions and 25 deletions
|
@ -146,9 +146,9 @@ main(int argc, char *argv[])
|
||||||
if (stat(*argv, &sb)) {
|
if (stat(*argv, &sb)) {
|
||||||
if (!cflag) {
|
if (!cflag) {
|
||||||
/* Create the file. */
|
/* Create the file. */
|
||||||
fd = open(*argv,
|
fd = _open(*argv,
|
||||||
O_WRONLY | O_CREAT, DEFFILEMODE);
|
O_WRONLY | O_CREAT, DEFFILEMODE);
|
||||||
if (fd == -1 || fstat(fd, &sb) || close(fd)) {
|
if (fd == -1 || fstat(fd, &sb) || _close(fd)) {
|
||||||
rval = 1;
|
rval = 1;
|
||||||
warn("%s", *argv);
|
warn("%s", *argv);
|
||||||
continue;
|
continue;
|
||||||
|
@ -300,37 +300,37 @@ rw(char *fname, struct stat *sbp, int force)
|
||||||
}
|
}
|
||||||
|
|
||||||
needed_chmod = rval = 0;
|
needed_chmod = rval = 0;
|
||||||
if ((fd = open(fname, O_RDWR, 0)) == -1) {
|
if ((fd = _open(fname, O_RDWR, 0)) == -1) {
|
||||||
if (!force || chmod(fname, DEFFILEMODE))
|
if (!force || _chmod(fname, DEFFILEMODE))
|
||||||
goto err;
|
goto err;
|
||||||
if ((fd = open(fname, O_RDWR, 0)) == -1)
|
if ((fd = _open(fname, O_RDWR, 0)) == -1)
|
||||||
goto err;
|
goto err;
|
||||||
needed_chmod = 1;
|
needed_chmod = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sbp->st_size != 0) {
|
if (sbp->st_size != 0) {
|
||||||
if (read(fd, &byte, sizeof(byte)) != sizeof(byte))
|
if (_read(fd, &byte, sizeof(byte)) != sizeof(byte))
|
||||||
goto err;
|
goto err;
|
||||||
if (lseek(fd, (off_t)0, SEEK_SET) == -1)
|
if (_lseek(fd, (off_t)0, SEEK_SET) == -1)
|
||||||
goto err;
|
goto err;
|
||||||
if (write(fd, &byte, sizeof(byte)) != sizeof(byte))
|
if (_write(fd, &byte, sizeof(byte)) != sizeof(byte))
|
||||||
goto err;
|
goto err;
|
||||||
} else {
|
} else {
|
||||||
if (write(fd, &byte, sizeof(byte)) != sizeof(byte)) {
|
if (_write(fd, &byte, sizeof(byte)) != sizeof(byte)) {
|
||||||
err: rval = 1;
|
err: rval = 1;
|
||||||
warn("%s", fname);
|
warn("%s", fname);
|
||||||
/* } else if (ftruncate(fd, (off_t)0)) {*/
|
/* } else if (ftruncate(fd, (off_t)0)) {*/
|
||||||
} else if (chsize(fd, (off_t)0)) {
|
} else if (_chsize(fd, (off_t)0)) {
|
||||||
rval = 1;
|
rval = 1;
|
||||||
warn("%s: file modified", fname);
|
warn("%s: file modified", fname);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (close(fd) && rval != 1) {
|
if (_close(fd) && rval != 1) {
|
||||||
rval = 1;
|
rval = 1;
|
||||||
warn("%s", fname);
|
warn("%s", fname);
|
||||||
}
|
}
|
||||||
if (needed_chmod && chmod(fname, sbp->st_mode) && rval != 1) {
|
if (needed_chmod && _chmod(fname, sbp->st_mode) && rval != 1) {
|
||||||
rval = 1;
|
rval = 1;
|
||||||
warn("%s: permissions modified", fname);
|
warn("%s: permissions modified", fname);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1075,14 +1075,14 @@ FTPRebuildConnectionInfo(const FTPLIPtr lip, const FTPCIPtr cip)
|
||||||
/* Reattach the FILE pointers for use with the Std I/O library
|
/* Reattach the FILE pointers for use with the Std I/O library
|
||||||
* routines.
|
* routines.
|
||||||
*/
|
*/
|
||||||
if ((cip->cin = fdopen(cip->ctrlSocketR, "r")) == NULL) {
|
if ((cip->cin = _fdopen(cip->ctrlSocketR, "r")) == NULL) {
|
||||||
cip->errNo = kErrFdopenR;
|
cip->errNo = kErrFdopenR;
|
||||||
cip->ctrlSocketR = kClosedFileDescriptor;
|
cip->ctrlSocketR = kClosedFileDescriptor;
|
||||||
cip->ctrlSocketW = kClosedFileDescriptor;
|
cip->ctrlSocketW = kClosedFileDescriptor;
|
||||||
return (kErrFdopenR);
|
return (kErrFdopenR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((cip->cout = fdopen(cip->ctrlSocketW, "w")) == NULL) {
|
if ((cip->cout = _fdopen(cip->ctrlSocketW, "w")) == NULL) {
|
||||||
CloseFile(&cip->cin);
|
CloseFile(&cip->cin);
|
||||||
cip->errNo = kErrFdopenW;
|
cip->errNo = kErrFdopenW;
|
||||||
cip->ctrlSocketR = kClosedFileDescriptor;
|
cip->ctrlSocketR = kClosedFileDescriptor;
|
||||||
|
|
|
@ -297,7 +297,7 @@ OpenBookmarkFile(int *numBookmarks0)
|
||||||
return NULL; /* Okay to not have one yet. */
|
return NULL; /* Okay to not have one yet. */
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) chmod(pathName, 00600);
|
(void) _chmod(pathName, 00600);
|
||||||
if (FGets(line, sizeof(line), fp) == NULL) {
|
if (FGets(line, sizeof(line), fp) == NULL) {
|
||||||
(void) fprintf(stderr, "%s: invalid format.\n", pathName);
|
(void) fprintf(stderr, "%s: invalid format.\n", pathName);
|
||||||
(void) fclose(fp);
|
(void) fclose(fp);
|
||||||
|
@ -683,7 +683,7 @@ OpenTmpBookmarkFile(int nb)
|
||||||
perror(pathName);
|
perror(pathName);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
(void) chmod(pathName, 00600);
|
(void) _chmod(pathName, 00600);
|
||||||
if (nb > 0) {
|
if (nb > 0) {
|
||||||
if (fprintf(outfp, "NcFTP bookmark-file version: %d\nNumber of bookmarks: %d\n", kBookmarkVersion, nb) < 0) {
|
if (fprintf(outfp, "NcFTP bookmark-file version: %d\nNumber of bookmarks: %d\n", kBookmarkVersion, nb) < 0) {
|
||||||
(void) fprintf(stderr, "Could not save bookmark.\n");
|
(void) fprintf(stderr, "Could not save bookmark.\n");
|
||||||
|
|
|
@ -2540,7 +2540,7 @@ PageCmd(const int argc, const char **const argv, const CommandPtr cmdp, const Ar
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (i=1; i<argc; i++) {
|
for (i=1; i<argc; i++) {
|
||||||
result = FTPGetOneFile2(&gConn, argv[i], NULL, kTypeAscii, fileno(stream), kResumeNo, kAppendNo);
|
result = FTPGetOneFile2(&gConn, argv[i], NULL, kTypeAscii, _fileno(stream), kResumeNo, kAppendNo);
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
if (errno != EPIPE) {
|
if (errno != EPIPE) {
|
||||||
ClosePager(stream);
|
ClosePager(stream);
|
||||||
|
|
|
@ -506,7 +506,7 @@ gl_init(void)
|
||||||
}
|
}
|
||||||
hist_init();
|
hist_init();
|
||||||
}
|
}
|
||||||
if (isatty(0) == 0 || isatty(1) == 0)
|
if (_isatty(0) == 0 || _isatty(1) == 0)
|
||||||
gl_error("\n*** Error: getline(): not interactive, use stdio.\n");
|
gl_error("\n*** Error: getline(): not interactive, use stdio.\n");
|
||||||
gl_char_init();
|
gl_char_init();
|
||||||
gl_init_done = 1;
|
gl_init_done = 1;
|
||||||
|
@ -2398,7 +2398,7 @@ gl_local_filename_completion_proc(const char *start, int idx)
|
||||||
if ((name[0] == '.') && ((name[1] == '\0') || ((name[1] == '.') && (name[2] == '\0'))))
|
if ((name[0] == '.') && ((name[1] == '\0') || ((name[1] == '.') && (name[2] == '\0'))))
|
||||||
goto next; /* Skip . and .. */
|
goto next; /* Skip . and .. */
|
||||||
|
|
||||||
if ((filepfxlen == 0) || (strnicmp(name, filepfx, filepfxlen) == 0)) {
|
if ((filepfxlen == 0) || (_strnicmp(name, filepfx, filepfxlen) == 0)) {
|
||||||
/* match */
|
/* match */
|
||||||
len = strlen(name);
|
len = strlen(name);
|
||||||
cp = (char *) malloc(filepfxoffset + len + 4 /* spare */ + 1 /* NUL */);
|
cp = (char *) malloc(filepfxoffset + len + 4 /* spare */ + 1 /* NUL */);
|
||||||
|
|
|
@ -321,7 +321,7 @@ LoadFirewallPrefs(int forceReload)
|
||||||
if (fp != NULL) {
|
if (fp != NULL) {
|
||||||
WriteDefaultFirewallPrefs(fp);
|
WriteDefaultFirewallPrefs(fp);
|
||||||
(void) fclose(fp);
|
(void) fclose(fp);
|
||||||
(void) chmod(pathName, 00600);
|
(void) _chmod(pathName, 00600);
|
||||||
gNumProgramRuns = 1;
|
gNumProgramRuns = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -649,7 +649,7 @@ SaveHistory(void)
|
||||||
|
|
||||||
gl_strlen = Vt100VisibleStrlen;
|
gl_strlen = Vt100VisibleStrlen;
|
||||||
gl_histsavefile(pathName);
|
gl_histsavefile(pathName);
|
||||||
(void) chmod(pathName, 00600);
|
(void) _chmod(pathName, 00600);
|
||||||
} /* SaveHistory */
|
} /* SaveHistory */
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ HaveSpool(void)
|
||||||
gHaveSpool = 0;
|
gHaveSpool = 0;
|
||||||
if (gOurInstallationPath[0] != '\0') {
|
if (gOurInstallationPath[0] != '\0') {
|
||||||
OurInstallationPath(ncftpbatch, sizeof(ncftpbatch), "ncftpbatch.exe");
|
OurInstallationPath(ncftpbatch, sizeof(ncftpbatch), "ncftpbatch.exe");
|
||||||
gHaveSpool = (access(ncftpbatch, F_OK) == 0) ? 1 : 0;
|
gHaveSpool = (_access(ncftpbatch, F_OK) == 0) ? 1 : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#elif defined(BINDIR)
|
#elif defined(BINDIR)
|
||||||
|
|
|
@ -125,7 +125,7 @@ OpenTrace(void)
|
||||||
|
|
||||||
fp = fopen(pathName, FOPEN_WRITE_TEXT);
|
fp = fopen(pathName, FOPEN_WRITE_TEXT);
|
||||||
if (fp != NULL) {
|
if (fp != NULL) {
|
||||||
(void) chmod(pathName, 00600);
|
(void) _chmod(pathName, 00600);
|
||||||
#ifdef HAVE_SETVBUF
|
#ifdef HAVE_SETVBUF
|
||||||
(void) setvbuf(fp, gTraceLBuf, _IOLBF, sizeof(gTraceLBuf));
|
(void) setvbuf(fp, gTraceLBuf, _IOLBF, sizeof(gTraceLBuf));
|
||||||
#endif /* HAVE_SETVBUF */
|
#endif /* HAVE_SETVBUF */
|
||||||
|
|
|
@ -69,7 +69,7 @@ loadFile(const char *fileName, int *fileSize_)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get file size */
|
/* Get file size */
|
||||||
if (fstat(fileno(f), &sb) < 0)
|
if (fstat(_fileno(f), &sb) < 0)
|
||||||
{
|
{
|
||||||
fclose(f);
|
fclose(f);
|
||||||
printf("Couldn't get size of file %s!\n", fileName);
|
printf("Couldn't get size of file %s!\n", fileName);
|
||||||
|
@ -506,7 +506,7 @@ applyPatch_file_open_error:
|
||||||
_snprintf(buffer, MAX_PATH, "%s.bak", fileName);
|
_snprintf(buffer, MAX_PATH, "%s.bak", fileName);
|
||||||
buffer[MAX_PATH-1] = '\0';
|
buffer[MAX_PATH-1] = '\0';
|
||||||
makeBackup = 1;
|
makeBackup = 1;
|
||||||
if (access(buffer, 0) >= 0) /* file exists */
|
if (_access(buffer, 0) >= 0) /* file exists */
|
||||||
{
|
{
|
||||||
printf("File %s already exists, overwrite? (Y)es, (N)o, (A)bort", buffer);
|
printf("File %s already exists, overwrite? (Y)es, (N)o, (A)bort", buffer);
|
||||||
do
|
do
|
||||||
|
|
Loading…
Reference in a new issue