# endif
#endif
-/* Put this after #includes because <unistd.h> defines _XOPEN_*. */
-#ifndef Sock_size_t
-# if _XOPEN_VERSION >= 5 || defined(_XOPEN_SOURCE_EXTENDED) || defined(__GLIBC__)
-# define Sock_size_t Size_t
-# else
-# define Sock_size_t int
-# endif
-#endif
-
bool
Perl_do_open(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
int rawmode, int rawperm, PerlIO *supplied_fp)
else {
dTHR;
if (ckWARN_d(WARN_INPLACE)) {
- if (!S_ISREG(PL_statbuf.st_mode))
+ int eno = errno;
+ if (PerlLIO_stat(PL_oldname, &PL_statbuf) >= 0
+ && !S_ISREG(PL_statbuf.st_mode))
+ {
Perl_warner(aTHX_ WARN_INPLACE,
"Can't do inplace edit: %s is not a regular file",
PL_oldname);
+ }
else
Perl_warner(aTHX_ WARN_INPLACE, "Can't open %s: %s",
- PL_oldname, Strerror(errno));
+ PL_oldname, Strerror(eno));
}
}
}
if (shm == (char *)-1) /* I hate System V IPC, I really do */
return -1;
if (optype == OP_SHMREAD) {
+ /* suppress warning when reading into undef var (tchrist 3/Mar/00) */
+ if (! SvOK(mstr))
+ sv_setpvn(mstr, "", 0);
SvPV_force(mstr, len);
mbuf = SvGROW(mstr, msize+1);