diff --git a/ffserver.c b/ffserver.c
index a6ab458de62ada0e242ac3216ad39da14e3a94ca..08f78785417a25b151d390ddf4632536c1384e08 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -56,7 +56,9 @@
 #include "libavutil/time.h"
 
 #include <stdarg.h>
+#if HAVE_UNISTD_H
 #include <unistd.h>
+#endif
 #include <fcntl.h>
 #include <sys/ioctl.h>
 #if HAVE_POLL_H