Comments (37)
OK. I've changed to i386.
from nnn.
I will check this. Thank you for the report.
from nnn.
Ahh, i386.
from nnn.
Can you please test if the following patch crashes at one of the files not shown?
diff --git a/nnn.c b/nnn.c
index 8eda2b3..b94ca40 100644
--- a/nnn.c
+++ b/nnn.c
@@ -1784,9 +1784,10 @@ dentfill(char *path, struct entry **dents,
if ((namep[0] == '.' && (namep[1] == '\0' || (namep[1] == '.' && namep[2] == '\0'))))
continue;
- if (fstatat(fd, namep, &sb, AT_SYMLINK_NOFOLLOW)
- == -1)
- continue;
+ if (fstatat(fd, namep, &sb, AT_SYMLINK_NOFOLLOW) == -1) {
+ DPRINTF_S(namep);
+ errexit();
+ }
if (S_ISDIR(sb.st_mode)) {
if (sb_path.st_dev == sb.st_dev) {
@@ -1816,7 +1817,7 @@ dentfill(char *path, struct entry **dents,
if (fstatat(fd, namep, &sb, AT_SYMLINK_NOFOLLOW) == -1) {
DPRINTF_S(namep);
- continue;
+ errexit();
}
if (n == total_dents) {
from nnn.
If it does, I believe we have to use stat64 versions instead of stat if the platform is i386.
from nnn.
Yes, it crashes.
line 1820: (75) Value too large for defined data type
from nnn.
Yes, that's because of the limitation of stat
on i386. We have to use stat64 or something.
from nnn.
Now, please remove the older patch and try the following:
diff --git a/nnn.c b/nnn.c
index 8eda2b3..dc679fb 100644
--- a/nnn.c
+++ b/nnn.c
@@ -22,6 +22,17 @@
#define LINUX_INOTIFY
#endif
#include <sys/resource.h>
+#ifdef __linux__
+#ifndef __USE_LARGEFILE64
+#define __USE_LARGEFILE64 1
+#endif
+#ifndef _LARGEFILE_SOURCE
+#define _LARGEFILE_SOURCE 1
+#endif
+#ifndef _LARGEFILE64_SOURCE
+#define _LARGEFILE64_SOURCE 1
+#endif
+#endif
#include <sys/stat.h>
#include <sys/statvfs.h>
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
from nnn.
Still no changes.
from nnn.
OK. I think it's better to run it on a VM and test. It will take some time.
BTW, is there any specific reason you are running a 32-bit OS? I am also considering explicitly removing support for 32-bit because most people use 64-bit nowadays.
from nnn.
I'm too lazy to reinstall my OS, it works for many years and I don't have any problems with it (at least with PAE kernel).
At the same time, for some other computers 64-bit OS is not an option. I'm talking about some old fun-boxes that still can be used. I think nnn
would be a great thing for those machines (nnn + tty = ♥).
from nnn.
Major distros like Arch and Fedora are phasing out 32-bit support. My problem is, I can't test and support newer changes on i386, both due to time and resource crunch. I'll probably add this fix and then call it a day for i386.
from nnn.
Major distros like Arch and Fedora are phasing out 32-bit support.
Well, they're have poor non-amd64 architectures support in general. Fortunately it's not an issue in Debian.
My problem is, I can't test and support newer changes on i386, both due to time and resource crunch. I'll probably add this fix and then call it a day for i386.
Thank you. That would be great. And I doubt there will be more problems with i386 support.
from nnn.
Can you try the following Makefile patch:
diff --git a/Makefile b/Makefile
index d281d0c..f83e8c9 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ VERSION = 1.4
PREFIX ?= /usr/local
MANPREFIX = $(PREFIX)/share/man
-CFLAGS += -O2 -Wall -Wextra -Wno-unused-parameter
+CFLAGS += -O2 -Wall -Wextra -Wno-unused-parameter -D_FILE_OFFSET_BITS=64
LDLIBS = -lreadline
ifeq ($(shell pkg-config ncursesw && echo 1),1)
As per this thread it should do the trick.
from nnn.
With or without previous nnn.c
patch?
from nnn.
Without the previous patch.
from nnn.
And if the Makefile patch works, try this one (without the Makefile patch):
diff --git a/nnn.c b/nnn.c
index 8eda2b3..7a6c357 100644
--- a/nnn.c
+++ b/nnn.c
@@ -22,6 +22,9 @@
#define LINUX_INOTIFY
#endif
#include <sys/resource.h>
+#ifdef __i386__
+#define FILE_OFFSET_BITS 64
+#endif
#include <sys/stat.h>
#include <sys/statvfs.h>
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
from nnn.
Makefile
patch works, but nnn.c
patch doesn't.
from nnn.
Which compiler are you using?
from nnn.
What do you mean?
Maybe I should change #ifdef __i386__
to #ifdef __i686__
in the last patch?
from nnn.
Sure! Try it out!
from nnn.
Otherwise, please move those 3 lines to the top. Just not sure if inotify.h includes stat.h internally.
from nnn.
No, i686 doesn't work either.
from nnn.
Otherwise, please move those 3 lines to the top. Just not sure if inotify.h includes stat.h internally.
Ok.
from nnn.
Moving those lines doesn't helped.
from nnn.
Try this:
diff --git a/nnn.c b/nnn.c
index 8eda2b3..cfbbc54 100644
--- a/nnn.c
+++ b/nnn.c
@@ -22,6 +22,9 @@
#define LINUX_INOTIFY
#endif
#include <sys/resource.h>
+#ifdef __i386__
+#define _FILE_OFFSET_BITS 64
+#endif
#include <sys/stat.h>
#include <sys/statvfs.h>
#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
from nnn.
No result.
from nnn.
I'll try with i686.
from nnn.
Also, please move it to the top and try.
from nnn.
Works now!
#ifdef __i686__
#define _FILE_OFFSET_BITS 64
#endif
on top before
#ifdef __linux__
from nnn.
OK
from nnn.
Wait a little.
from nnn.
Try the following:
diff --git a/nnn.c b/nnn.c
index 8eda2b3..fc893a2 100644
--- a/nnn.c
+++ b/nnn.c
@@ -18,6 +18,9 @@
*/
#ifdef __linux__
+#ifdef __i686__
+#define _FILE_OFFSET_BITS 64
+#endif
#include <sys/inotify.h>
#define LINUX_INOTIFY
#endif
I am trying to limit this as Linux-only till I get reports from other platforms.
from nnn.
Works too.
from nnn.
Awesome!
I'll push the patch soon!
from nnn.
Thanks a lot for your help!
from nnn.
Thank you.
By the way, #ifdef __i386__
works too, so maybe it's better to prefer 386 over 686.
from nnn.
Related Issues (20)
- Respect keys regardless of kb language input HOT 4
- Visual Glitch, visual bug, the whole screen breaks, resize does something, redraw does not HOT 3
- Sorting bug, different behavior for t and ^T HOT 2
- Misleading typo in the wiki HOT 1
- [plugin] file preview panel get stuck when use plugin preview-tui with tmux and bat HOT 2
- Keybind collision when using the colemak patch HOT 5
- malloc: error pointer being freed was not allocated HOT 9
- The first letter of the file is not correct after change dir HOT 2
- mess with shell colors HOT 8
- [bash] nnn can't return after executing command (] key) if invoked from a `bind -x` keybinding. HOT 4
- preview-tui: 1: eval: Syntax error: "(" unexpected HOT 6
- Dirs in context color (-D) not working HOT 1
- The preview pane sometimes does not repaint when using kitty HOT 3
- prompt not respecting aliases defined in .zshrc HOT 4
- how to remove cp/mv confirmation prompt while copying/moving files/folders HOT 3
- Build error: `mach_gettime.h:5:10: fatal error: sys/_types/_timespec.h: No such file or directory` HOT 12
- 'open with' not working HOT 8
- preview-tui: `create pane failed: -l invalid`
- Session does not store configuration settings (?) HOT 3
- Detail view sometimes highlights all files (not just last 5 min) HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nnn.