sh4-div.patch
来自「linux下编译交叉工具链的工具源码」· PATCH 代码 · 共 34 行
PATCH
34 行
Fixes odd problem where rcp aborts on sh4 with gcc <= 3.0.2.The preprocessed source that causes the error is size = ((((((stb).st_blksize > 0 ? (stb).st_blksize : 512))+((blksize)-1))/(blksize))*(blksize));When the bug hits, size is set to a rediculously large number, causingan allocation to fail.See http://sources.redhat.com/ml/crossgcc/2003-07/msg00054.html--- inetutils-1.4.2/rcp/util.c.old Tue Jul 8 11:38:47 2003+++ inetutils-1.4.2/rcp/util.c Tue Jul 8 11:40:03 2003@@ -130,6 +130,11 @@ return (status); } +static size_t froundup(size_t x, size_t y)+{+ return (((x+(y-1))/y)*y);+}+ BUF * allocbuf(BUF *bp, int fd, int blksize) {@@ -140,10 +145,7 @@ run_err("fstat: %s", strerror(errno)); return (0); }-#ifndef roundup-# define roundup(x, y) ((((x)+((y)-1))/(y))*(y))-#endif- size = roundup(ST_BLKSIZE(stb), blksize);+ size = froundup(ST_BLKSIZE(stb), blksize); if (size == 0) size = blksize; if (bp->cnt >= size)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?