File: 0030_fix-gcc-warnings.patch

package info (click to toggle)
fgetty 0.7-12
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 300 kB
  • sloc: ansic: 2,170; makefile: 226
file content (40 lines) | stat: -rw-r--r-- 913 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Description: Fix GCC warnings about implict type declarations
 The main function in login.c and login2.c doesn't explicitly declare its type.
 This patch fixes that. Also added #include <ctype.h> to fgetty.c.
Author: Francisco M Neto <fmneto@fmneto.com>
Last-Update: 2020-09-04
--- a/login2.c
+++ b/login2.c
@@ -57,7 +57,7 @@
   close(5);
 }
 
-main(int argc,char *argv[]) {
+int main(int argc,char *argv[]) {
   int fd;
   char *shell=getenv("SHELL");
   char *Argv[]={"-sh",0};
--- a/login.c
+++ b/login.c
@@ -58,7 +58,7 @@
   tcsetattr(0, TCSANOW, &oldtermios);
 }
 
-main(int argc,char *argv[]) {
+int main(int argc,char *argv[]) {
   int filedes[2];
   char *username=argv[1];
   char *buf;
--- a/fgetty.c
+++ b/fgetty.c
@@ -11,6 +11,10 @@
 #include <errno.h>
 #include <termios.h>
 #include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+#include <time.h>
+#include <sys/stat.h>
 
 #include "fmt.h"