Junio C Hamano wrote:Can we use fileno()? Something like: FILE *gitfopen(const char *path, const char *mode) { FILE *fp; struct stat st; if (strpbrk(mode, "wa")) return fopen(path, mode); if (!(fp = fopen(path, mode))) return NULL; if (fstat(fileno(fp), &st)) { fclose(fp); return NULL; } if (S_ISDIR(st.st_mode)) { fclose(fp); errno = EISDIR; return NULL; } return fp; } -brandon - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Greg Kroah-Hartman | [PATCH 008/196] Chinese: add translation of volatile-considered-harmful.txt |
| Amit K. Arora | [RFC] Heads up on sys_fallocate() |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| Linus Torvalds | Re: Slow DOWN, please!!! |
git: | |
| Gerrit Renker | [PATCH 0/37] dccp: Feature negotiation - last call for comments |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Natalie Protasevich | [BUG] New Kernel Bugs |
