Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option for gmap.html location #163

Open
sdgathman opened this issue Aug 2, 2021 · 0 comments
Open

Option for gmap.html location #163

sdgathman opened this issue Aug 2, 2021 · 0 comments

Comments

@sdgathman
Copy link

For Fedora packaging, I moved gmap.html to /usr/share so it will run out of the box for any user. It would be nice to configure on command line (or even a config file). I will propose a patch at some point. I do NOT recommend the below patch for the repo - it is just to show what I did for Fedora.

 #include "rtl-sdr.h"
 #include "anet.h"
 
+#define GMAP_HTML	"/usr/share/dump1090/gmap.html"
 #define MODES_DEFAULT_RATE         2000000
 #define MODES_DEFAULT_FREQ         1090000000
 #define MODES_DEFAULT_WIDTH        1000
@@ -2253,8 +2254,8 @@ int handleHTTPRequest(struct client *c)
         struct stat sbuf;
         int fd = -1;
 
-        if (stat("gmap.html",&sbuf) != -1 &&
-            (fd = open("gmap.html",O_RDONLY)) != -1)
+        if (stat(GMAP_HTML,&sbuf) != -1 &&
+            (fd = open(GMAP_HTML,O_RDONLY)) != -1)
         {
             content = malloc(sbuf.st_size);
             if (read(fd,content,sbuf.st_size) == -1) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant