tor-commits
Threads by month
- ----- 2025 -----
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
January 2012
- 14 participants
- 852 discussions
commit 20a81b9473e607ef51b80a83ebfdf02264833881
Author: Translation commit bot <translation(a)torproject.org>
Date: Tue Jan 31 22:45:04 2012 +0000
Update translations for tsum
---
ru/tsum.po | 39 +++++++++++++++++++++++++++++++++++++--
1 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/ru/tsum.po b/ru/tsum.po
index 474658b..19f336d 100644
--- a/ru/tsum.po
+++ b/ru/tsum.po
@@ -9,7 +9,7 @@ msgstr ""
"Project-Id-Version: The Tor Project\n"
"Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n"
"POT-Creation-Date: 2011-11-05 17:16+0000\n"
-"PO-Revision-Date: 2012-01-31 22:14+0000\n"
+"PO-Revision-Date: 2012-01-31 22:39+0000\n"
"Last-Translator: liquixis <liquixis(a)gmail.com>\n"
"Language-Team: Russian (http://www.transifex.net/projects/p/torproject/team/ru/)\n"
"MIME-Version: 1.0\n"
@@ -58,11 +58,16 @@ msgid ""
"three random servers (also known as *relays*) in the Tor network, before the"
" traffic is sent out onto the public Internet."
msgstr ""
+"Tor - это сеть виртуальных туннелей, которая позволяет вам улучшить вашу "
+"приватность и безопасность в Интернет. Tor работает следующим образом: он "
+"отправляет ваш трафик через три произвольных сервера (так же известных как "
+"*ретрансляторы*) в сети Tor до того как этот трафик выйдет в публичную сеть "
+"Интернет."
#. type: Plain text
#: en/tsum.text:21
msgid ""
-msgstr ""
+msgstr ""
#. type: Plain text
#: en/tsum.text:26
@@ -71,6 +76,10 @@ msgid ""
"The green monitors represent relays in the Tor network, while the three keys"
" represent the layers of encryption between the user and each relay."
msgstr ""
+"Изображение выше иллюстрирует пользователя просматривающего различные сайты "
+"через Tor. Зеленые мониторы обозначают ретрансляторы в сети Tor, а три ключа"
+" представляют собой уровни шифрования между пользователем и каждым "
+"ретранслятором."
#. type: Plain text
#: en/tsum.text:31
@@ -80,6 +89,9 @@ msgid ""
"traffic inside the Tor network, but it cannot encrypt your traffic between "
"the Tor network and its final destination."
msgstr ""
+"Tor скроет источник вашего трафика и будет шифровать всё между вами и сетью "
+"Tor. Tor так же будет шифровать ваш трафик внутри сети Tor, но он не сможет "
+"шифровать ваш трафик между сетью Tor и его конечным пунктом назначения."
#. type: Plain text
#: en/tsum.text:36
@@ -96,6 +108,8 @@ msgid ""
"How to download Tor\n"
"-------------------\n"
msgstr ""
+"Как скачать Tor\n"
+"---------------\n"
#. type: Plain text
#: en/tsum.text:44
@@ -106,6 +120,11 @@ msgid ""
"and requires no installation. You download the bundle, extract the archive, "
"and start Tor."
msgstr ""
+"Дистрибутив, который мы рекомендуем большинству пользователей - это [Tor "
+"Browser Bundle](https://www.torproject.org/projects/torbrowser.html). Данный"
+" дистрибутив содержит браузер предварительно настроенный для безопасного "
+"работы в Интернет через Tor, а так же не требует установки. Вы скачиваете "
+"дистрибутив, распаковываете архив и запускаете Tor."
#. type: Plain text
#: en/tsum.text:48
@@ -129,6 +148,9 @@ msgid ""
"**macos-i386**), and Linux (write **linux-i386** for 32-bit systems or "
"**linux-x86_64** for 64-bit systems)."
msgstr ""
+"Вы так же можете запросить Tor Browser Bundle для Mac OS X (пишем "
+"**macos-i386**) и Linux (пишем **linux-i386** - для 32-битных систем или "
+"**linux-x86_64** - для 64-битных систем)."
#. type: Plain text
#: en/tsum.text:61
@@ -136,6 +158,8 @@ msgid ""
"If you want a translated version of Tor, write **help** instead. You will "
"then receive an email with instructions and a list of available languages."
msgstr ""
+"Если вам нужна переведенная версия Tor, напишите **help**. После этого вы "
+"получите письмо с инструкциями и список доступных языков."
#. type: Plain text
#: en/tsum.text:67
@@ -486,6 +510,11 @@ msgid ""
"3. Click on the *View* tab\n"
"4. Uncheck *Hide extensions for known file types* and click *OK*"
msgstr ""
+"#### Windows XP⏎\n"
+"1. Открыть *Мой компьютер*\n"
+"2. Нажмите *Сервис* и выберите *Свойства папки...* в меню\n"
+"3. Откройте вкладку *Вид*\n"
+"4. Снимите галку *Скрывать расширения для зарегистрированных типов файлов* и нажмите *OK*"
#. type: Plain text
#: en/tsum.text:260
@@ -566,6 +595,8 @@ msgid ""
"### Flash does not work\n"
"For security reasons, Flash, Java, and other plugins are currently disabled for Tor. Plugins operate independently from Firefox and can perform activity on your computer that ruins your anonymity."
msgstr ""
+"### Flash не работает\n"
+"В целях безопасности Flash, Java и другие плагины отключены для работы с Tor. Плагины работают независимо от Firefox и могут выполнять действия на вашем компьютере которые разрушают вашу анонимность."
#. type: Plain text
#: en/tsum.text:308
@@ -596,6 +627,8 @@ msgid ""
"### I want to use another browser\n"
"For security reasons, we recommend that you only browse the web through Tor using the Tor Browser Bundle. It is technically possible to use Tor with other browsers, but by doing so you open yourself up to potential attacks."
msgstr ""
+"### Я хочу использовать другой браузер\n"
+"Мы рекомендуем вам в целях безопасности работать в Интернет через Tor используя только Tor Browser Bundle. Технически возможно использовать Tor с другими браузерами, но делая это вы становитесь доступным для потенциальных атак."
#. type: Plain text
#: en/tsum.text:325
@@ -603,5 +636,7 @@ msgid ""
"### Why Tor is slow\n"
"Tor can sometimes be a bit slower than your normal Internet connection. After all, your traffic is sent through many different countries, sometimes across oceans around the world!"
msgstr ""
+"### Почему Tor медленный\n"
+"Tor иногда может быть немного медленнее чем ваше обычное Интернет соединение. В конце концов, ваш трафик проходит через множество разных стран, иногда через океаны по всему миру!"
1
0

r25363: {website} we don't want you to translate our website anymore. (website/trunk/getinvolved/en)
by Roger Dingledine 31 Jan '12
by Roger Dingledine 31 Jan '12
31 Jan '12
Author: arma
Date: 2012-01-31 22:45:04 +0000 (Tue, 31 Jan 2012)
New Revision: 25363
Modified:
website/trunk/getinvolved/en/tshirt.wml
Log:
we don't want you to translate our website anymore.
Modified: website/trunk/getinvolved/en/tshirt.wml
===================================================================
--- website/trunk/getinvolved/en/tshirt.wml 2012-01-31 21:13:54 UTC (rev 25362)
+++ website/trunk/getinvolved/en/tshirt.wml 2012-01-31 22:45:04 UTC (rev 25363)
@@ -24,7 +24,7 @@
allow exits to port 80 and you average 100 KB/s traffic, or if you're
not an exit but you average 500 KB/s traffic.</li>
<li>Help out in <a href="<page getinvolved/volunteer>">other ways</a>. <a href="<page
- getinvolved/translation>">Maintain a translation for the website</a>. Write a good <a
+ getinvolved/translation>">Maintain a translation</a>. Write a good <a
href="<wiki>doc/SupportPrograms">support
program and get a lot of people to use it</a>. Do research on Tor
and anonymity, solve some of <a href="https://bugs.torproject.org/">our
1
0

[translation/vidalia_help] Update translations for vidalia_help
by translation@torproject.org 31 Jan '12
by translation@torproject.org 31 Jan '12
31 Jan '12
commit 0e2cb284b02dc07b6e1655f7a2e2b6f11696e188
Author: Translation commit bot <translation(a)torproject.org>
Date: Tue Jan 31 22:15:20 2012 +0000
Update translations for vidalia_help
---
ru/links.po | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/ru/links.po b/ru/links.po
index 79a565c..2146d9a 100644
--- a/ru/links.po
+++ b/ru/links.po
@@ -1,13 +1,14 @@
#
# Translators:
+# <liquixis(a)gmail.com>, 2012.
# runasand <runa.sandvik(a)gmail.com>, 2011.
msgid ""
msgstr ""
"Project-Id-Version: The Tor Project\n"
"Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n"
"POT-Creation-Date: 2011-05-05 20:21+0200\n"
-"PO-Revision-Date: 2010-11-30 05:02+0000\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"PO-Revision-Date: 2012-01-31 22:12+0000\n"
+"Last-Translator: liquixis <liquixis(a)gmail.com>\n"
"Language-Team: Russian (http://www.transifex.net/projects/p/torproject/team/ru/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -47,12 +48,12 @@ msgstr ""
#. type: Content of: <html><body><table><tr><td>
#: links.html:31 links.html:58
msgid "Wiki and Bugtracker"
-msgstr ""
+msgstr "Wiki и Bugtracker"
#. type: Content of: <html><body><table><tr><td>
#: links.html:33
msgid "<a href=\"http://trac.torproject.org/\"> http://trac.torproject.org/</a>"
-msgstr ""
+msgstr "<a href=\"http://trac.torproject.org/\"> http://trac.torproject.org/</a>"
#. type: Content of: <html><body><h3>
#: links.html:39
@@ -75,10 +76,13 @@ msgid ""
"<a href=\"https://www.torproject.org/docs/faq.html\"> "
"https://www.torproject.org/docs/faq.html</a>"
msgstr ""
+"<a href=\"https://www.torproject.org/docs/faq.html\"> "
+"https://www.torproject.org/docs/faq.html</a>"
#. type: Content of: <html><body><table><tr><td>
#: links.html:60
msgid "<a href=\"https://trac.torproject.org/\"> https://trac.torproject.org/</a>"
msgstr ""
+"<a href=\"https://trac.torproject.org/\"> https://trac.torproject.org/</a>"
1
0
commit 80db6b5ff0ea48cd6a0829f036156c3ba90a070b
Author: Translation commit bot <translation(a)torproject.org>
Date: Tue Jan 31 22:15:04 2012 +0000
Update translations for tsum
---
ru/tsum.po | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/ru/tsum.po b/ru/tsum.po
index 4f8a21c..474658b 100644
--- a/ru/tsum.po
+++ b/ru/tsum.po
@@ -3,13 +3,14 @@
# This file is distributed under the same license as the PACKAGE package.
#
# Translators:
+# <liquixis(a)gmail.com>, 2012.
msgid ""
msgstr ""
"Project-Id-Version: The Tor Project\n"
"Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n"
"POT-Creation-Date: 2011-11-05 17:16+0000\n"
-"PO-Revision-Date: 2011-11-05 21:28+0000\n"
-"Last-Translator: runasand <runa.sandvik(a)gmail.com>\n"
+"PO-Revision-Date: 2012-01-31 22:14+0000\n"
+"Last-Translator: liquixis <liquixis(a)gmail.com>\n"
"Language-Team: Russian (http://www.transifex.net/projects/p/torproject/team/ru/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -46,6 +47,8 @@ msgid ""
"How Tor works\n"
"-------------\n"
msgstr ""
+"Как работает Tor\n"
+"----------------\n"
#. type: Plain text
#: en/tsum.text:19
1
0

31 Jan '12
commit ba3eaeb36162633246a736de4d004c9c65b21e87
Author: Translation commit bot <translation(a)torproject.org>
Date: Tue Jan 31 21:45:15 2012 +0000
Update translations for vidalia
---
ru/vidalia_ru.po | 80 +++++++++++++++++++++++++++--------------------------
1 files changed, 41 insertions(+), 39 deletions(-)
diff --git a/ru/vidalia_ru.po b/ru/vidalia_ru.po
index 70fb758..959f42a 100644
--- a/ru/vidalia_ru.po
+++ b/ru/vidalia_ru.po
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: The Tor Project\n"
"Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n"
"POT-Creation-Date: 2011-09-07 14:40+0000\n"
-"PO-Revision-Date: 2012-01-31 20:46+0000\n"
+"PO-Revision-Date: 2012-01-31 21:42+0000\n"
"Last-Translator: liquixis <liquixis(a)gmail.com>\n"
"Language-Team: Russian (http://www.transifex.net/projects/p/torproject/team/ru/)\n"
"MIME-Version: 1.0\n"
@@ -272,7 +272,7 @@ msgstr "Стиль"
msgctxt "BandwidthGraph"
msgid "Changes the transparency of the Bandwidth Graph"
-msgstr "Изменение прозрачности графика трафика"
+msgstr "Изменяет прозрачность графика пропускной "
msgctxt "BandwidthGraph"
msgid "100"
@@ -408,7 +408,7 @@ msgstr "Внешний вид"
msgctxt "ConfigDialog"
msgid "Advanced"
-msgstr "Расширенный"
+msgstr "Дополнительное"
msgctxt "ConfigDialog"
msgid "Help"
@@ -1660,7 +1660,7 @@ msgstr "Настройки"
msgctxt "MainWindow"
msgid "About"
-msgstr "Справка"
+msgstr "О программе"
msgctxt "MainWindow"
msgid "Help"
@@ -2425,7 +2425,7 @@ msgstr "Статус Tor"
msgctxt "MessageLog"
msgid "Advanced"
-msgstr "Расширенные"
+msgstr "Дополнительное"
msgctxt "MessageLog"
msgid "Always Save New Log Messages"
@@ -2452,14 +2452,18 @@ msgid ""
"not considered errors, but you may \n"
"care about."
msgstr ""
-"Сообщения которые появляются редко во время нормальной работы Tor и не "
-"считаются ошибками, но вы можете уделить им внимание."
+"Сообщения которые появляются редко\n"
+"во время нормальной работы Tor\n"
+"и не считаются ошибками,\n"
+"но вы можете уделить им внимание."
msgctxt "MessageLog"
msgid ""
"Messages that appear frequently \n"
"during normal Tor operation."
-msgstr "Сообщения, которые часто появляются во время нормальной работы Tor."
+msgstr ""
+"Сообщения, которые часто появляются\n"
+"во время нормальной работы Tor."
msgctxt "MessageLog"
msgid ""
@@ -2665,7 +2669,7 @@ msgid ""
"access the Tor network"
msgstr ""
"Удостоверьтесь, что запросы каталогa шифруются и, при необходимости, "
-"используются ретрансляторы мостов для доступа к сети Tor"
+"используются мосты для доступа к сети Tor"
msgctxt "NetworkPage"
msgid "My ISP blocks connections to the Tor network"
@@ -2673,7 +2677,7 @@ msgstr "Мой провайдер блокирует доступ к сети To
msgctxt "NetworkPage"
msgid "Bridge Settings"
-msgstr "Настройки Моста"
+msgstr "Настройки моста"
msgctxt "NetworkPage"
msgid "Add a Bridge:"
@@ -2689,7 +2693,7 @@ msgstr "Копировать выделенные мосты в буфер об
msgctxt "NetworkPage"
msgid "Find Bridges Now"
-msgstr "Найти Мосты"
+msgstr "Найти мосты"
msgctxt "NetworkPage"
msgid "<a href=\"bridges.finding\">How else can I find bridges?</a>"
@@ -2779,9 +2783,7 @@ msgstr "Трафик:"
msgctxt "RouterDescriptorView"
msgid "Uptime:"
-msgstr ""
-"Время работы\n"
-":"
+msgstr "Время работы:"
msgctxt "RouterDescriptorView"
msgid "Last Updated:"
@@ -2885,7 +2887,7 @@ msgstr "Копировать"
msgctxt "RouterListWidget"
msgid "Nickname"
-msgstr "Прозвище"
+msgstr "Ник"
msgctxt "RouterListWidget"
msgid "Fingerprint"
@@ -2893,15 +2895,15 @@ msgstr "Отпечаток"
msgctxt "ServerPage"
msgid "Bridge Support Unavailable"
-msgstr "Поддержка Моста недоступна"
+msgstr "Поддержка моста недоступна"
msgctxt "ServerPage"
msgid ""
"You have configured Tor to act as a bridge relay for censored users, but "
"your version of Tor does not support bridges."
msgstr ""
-"Вы настроили Tor в качестве ретранслятора моста для заблокированных "
-"пользователей, но ваша версия Tor не поддерживает мостов."
+"Вы настроили Tor в качестве моста для заблокированных пользователей, но ваша"
+" версия Tor не поддерживает мостов."
msgctxt "ServerPage"
msgid ""
@@ -3014,7 +3016,7 @@ msgstr "Выберите то, что более всего похоже на в
msgctxt "ServerPage"
msgid "Show help topic on bandwidth rate limits"
-msgstr "Показать помощь по пределам пропускной скорости"
+msgstr "Показать помощь по ограничениям пропускной способности"
msgctxt "ServerPage"
msgid "Average Rate"
@@ -3034,19 +3036,19 @@ msgstr "Максимальная скорость"
msgctxt "ServerPage"
msgid "Peak bandwidth rate limit"
-msgstr "Предел скорости при пиковай пропускная способности"
+msgstr "Мгновенный предел пропускной способности"
msgctxt "ServerPage"
msgid ""
"Your maximum bandwidth rate must be greater than or equal to your average "
"bandwidth rate. Both values must be at least 20 KB/s."
msgstr ""
-"Максимальная пропускная способность должна быть больше или равна среднего "
-"уровня трафика. Оба значения должны быть не меньше 20КБ/с"
+"Максимальная пропускная способность должна быть больше или равна вашей "
+"средней пропускной способности. Оба значения должны быть не менее 20 КБ/с."
msgctxt "ServerPage"
msgid "Bandwidth Limits"
-msgstr "Пределы полосы пропускания"
+msgstr "Пределы пропускной способности"
msgctxt "ServerPage"
msgid "Ports 6660 - 6669 and 6697"
@@ -3153,7 +3155,7 @@ msgstr ""
msgctxt "ServerPage"
msgid "Bridge History"
-msgstr "История Мостa"
+msgstr "История мостa"
msgctxt "ServerPage"
msgid "Vidalia was unable to retrieve your bridge's usage history."
@@ -3466,8 +3468,8 @@ msgid ""
"relay's configuration."
msgstr ""
"Tor определил, что публичный IP адрес вашего ретранслятора сейчас - %1%2. "
-"Если это неверно, пожалуйста рассмотрите возможность установки опции 'Адрес'"
-" в настройках вашего ретранслятора."
+"Если это неверно, пожалуйста, рассмотрите возможность установки опции "
+"'Адрес' в настройках вашего ретранслятора."
msgctxt "StatusEventWidget"
msgid "DNS Hijacking Detected"
@@ -3505,7 +3507,7 @@ msgid ""
" Tor network by connecting to itself at %1:%2. This test could take several "
"minutes."
msgstr ""
-"Tor пытается определить доступность порта вашего сервера ретрансляции из "
+"Tor пытается определить доступность порта сервера вашего ретранслятора из "
"сети Tor, соединяясь с самим собой на %1:%2. Этот тест может занять "
"несколько минут."
@@ -3515,7 +3517,7 @@ msgstr "Проверка доступности порта сервера зав
msgctxt "StatusEventWidget"
msgid "Your relay's server port is reachable from the Tor network!"
-msgstr "Порт вашего сервера ретрансляции доступен в сети Tor!"
+msgstr "Порт сервера вашего ретранслятора доступен в сети Tor!"
msgctxt "StatusEventWidget"
msgid "Server Port Reachability Test Failed"
@@ -3528,7 +3530,7 @@ msgid ""
"port forwarding. If %1:%2 is not your correct IP address and server port, "
"please check your relay's configuration."
msgstr ""
-"Порт вашего сервера ретрансляции недоступен другим клиентам Tor. Это может "
+"Порт сервера вашего ретранслятора недоступен другим клиентам Tor. Это может "
"происходить если вы находитесь за роутером или брандмауэром, что требует от "
"вас настроить проброс портов. Если %1:%2 не ваши правильные IP адрес и порт "
"сервера, пожалуйста, проверьте настройки вашего ретранслятора."
@@ -3543,8 +3545,8 @@ msgid ""
"the Tor network by connecting to itself at %1:%2. This test could take "
"several minutes."
msgstr ""
-"Tor пытается определить доступен ли порт вашего каталога ретрансляции в сети"
-" Tor, путем соединения с сами собой на %1:%2. Этот тест может занять "
+"Tor пытается определить доступен ли порт каталога вашего ретранслятора в "
+"сети Tor, путем соединения с сами собой на %1:%2. Этот тест может занять "
"несколько минут."
msgctxt "StatusEventWidget"
@@ -3553,7 +3555,7 @@ msgstr "Проверка доступности порта каталога за
msgctxt "StatusEventWidget"
msgid "Your relay's directory port is reachable from the Tor network!"
-msgstr "Порт вашего каталога ретрансляции доступен в сети Tor!"
+msgstr "Порт каталога вашего ретранслятора доступен в сети Tor!"
msgctxt "StatusEventWidget"
msgid "Directory Port Reachability Test Failed"
@@ -3566,14 +3568,14 @@ msgid ""
"port forwarding. If %1:%2 is not your correct IP address and directory port,"
" please check your relay's configuration."
msgstr ""
-"Порт вашего каталога ретрансляции недоступен другим клиентам Tor. Это может "
-"происходить если вы находитесь за роутером или брандмауэром, что требует от "
-"вас настроить проброс портов. Если %1:%2 не ваши правильные IP адрес и порт "
-"каталога, пожалуйста, проверьте настройки вашего ретранслятора."
+"Порт каталога вашего ретранслятора недоступен другим клиентам Tor. Это может"
+" происходить если вы находитесь за роутером или брандмауэром, что требует от"
+" вас настроить проброс портов. Если %1:%2 не ваши правильные IP адрес и порт"
+" каталога, пожалуйста, проверьте настройки вашего ретранслятора."
msgctxt "StatusEventWidget"
msgid "Relay Descriptor Rejected"
-msgstr "Дескриптор Ретранслятора Отклонён"
+msgstr "Дескриптор ретранслятора отклонён"
msgctxt "StatusEventWidget"
msgid ""
@@ -3597,7 +3599,7 @@ msgid ""
msgstr ""
"Ваш ретранслятор теперь в сети и доступен клиентам Tor для использования. В "
"течение ближайших часов вы можете заметить увеличение сетевого трафика, "
-"отображаемого на Графике Пропускной способности, по мере того, как новые "
+"отображаемого на графике пропускной способности, по мере того, как новые "
"клиенты будут узнавать о вашем ретрансляторе. Спасибо вам за помощь сети "
"Tor!"
@@ -3761,7 +3763,7 @@ msgstr "Обновление карты каталога портов "
msgctxt "UPNPTestDialog"
msgid "Updating relay port mapping"
-msgstr "Обновление карты портов серверов"
+msgstr "Обновление распределения портов ретрансляторов"
msgctxt "UPNPTestDialog"
msgid "Test completed successfully!"
1
0

31 Jan '12
commit d85f83796bb971fe55e56e60a3ee39e4cac1887a
Author: Translation commit bot <translation(a)torproject.org>
Date: Tue Jan 31 21:15:16 2012 +0000
Update translations for vidalia
---
pt_BR/vidalia_pt_BR.po | 39 ++++++++++++++++++++++++++++-----------
ru/vidalia_ru.po | 14 +++++++-------
2 files changed, 35 insertions(+), 18 deletions(-)
diff --git a/pt_BR/vidalia_pt_BR.po b/pt_BR/vidalia_pt_BR.po
index 1d48ca6..d02cc4a 100644
--- a/pt_BR/vidalia_pt_BR.po
+++ b/pt_BR/vidalia_pt_BR.po
@@ -9,8 +9,8 @@ msgstr ""
"Project-Id-Version: The Tor Project\n"
"Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n"
"POT-Creation-Date: 2011-09-07 14:40+0000\n"
-"PO-Revision-Date: 2012-01-31 20:44+0000\n"
-"Last-Translator: daniel <>\n"
+"PO-Revision-Date: 2012-01-31 20:57+0000\n"
+"Last-Translator: yermandu daniel <yermandu(a)gmail.com>\n"
"Language-Team: translations(a)vidalia-project.net\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -1309,6 +1309,8 @@ msgid ""
"<a "
"href=\"https://trac.torproject.org/projects/tor/newticket\">https://trac.torproject.org/projects/tor/newticket</a>"
msgstr ""
+"<a "
+"href=\"https://trac.torproject.org/projects/tor/newticket\">https://trac.torproject.org/projects/tor/newticket</a>"
msgctxt "CrashReportDialog"
msgid ""
@@ -2132,7 +2134,7 @@ msgstr ""
msgctxt "MainWindow"
msgid "Bootstrapping torrc from %1 to %2"
-msgstr ""
+msgstr "Inicialização do torrc %1 de %2"
msgctxt "MainWindow"
msgid ""
@@ -3479,9 +3481,9 @@ msgid ""
" is not correct, please consider setting the 'Address' option in your "
"relay's configuration."
msgstr ""
-"Tor tem determinado o endereço público do seu relé IP é atualmente %1%2. Se "
-"isso não está correto, por favor, considere a definição do 'Endereço' opção "
-"na configuração do seu relay."
+"Tor tem determinado o endereço público do seu relay IP é atualmente %1%2. Se"
+" isso não está correto, por favor, considere a definição do 'Endereço' opção"
+" na configuração do seu relay."
msgctxt "StatusEventWidget"
msgid "DNS Hijacking Detected"
@@ -3519,9 +3521,9 @@ msgid ""
" Tor network by connecting to itself at %1:%2. This test could take several "
"minutes."
msgstr ""
-"Tor está tentando determinar se a porta do seu servidor relé está acessível"
-" a partir da rede Tor, ligando a si mesmo em %1:%2. Este teste pode demorar "
-"alguns minutos."
+"Tor está tentando determinar se a porta do seu servidor relay está "
+"acessível a partir da rede Tor, ligando a si mesmo em %1:%2. Este teste pode"
+" demorar alguns minutos."
msgctxt "StatusEventWidget"
msgid "Server Port Reachability Test Successful!"
@@ -3542,6 +3544,11 @@ msgid ""
"port forwarding. If %1:%2 is not your correct IP address and server port, "
"please check your relay's configuration."
msgstr ""
+"Sua porta do servidor relay não está alcançável por outros clientes Tor. "
+"Isso pode acontecer se você estiver atrás de um roteador ou firewall que "
+"requer que você configure o encaminhamento de porta. Se %1:%2 não é o seu "
+"endereço IP correto e a porta do servidor, por favor, verifique a "
+"configuração do seu relay."
msgctxt "StatusEventWidget"
msgid "Checking Directory Port Reachability"
@@ -3553,6 +3560,9 @@ msgid ""
"the Tor network by connecting to itself at %1:%2. This test could take "
"several minutes."
msgstr ""
+"Tor está tentando determinar se a porta do seu diretório de relay está "
+"alcansavél da rede Tor por conectar-se à %1:%2. Este teste pode levar alguns"
+" minutos."
msgctxt "StatusEventWidget"
msgid "Directory Port Reachability Test Successful!"
@@ -3560,7 +3570,7 @@ msgstr "Acessibilidade à Porta do Diretório com Sucesso!"
msgctxt "StatusEventWidget"
msgid "Your relay's directory port is reachable from the Tor network!"
-msgstr ""
+msgstr "Sua porta do diretório de relay está alcançavél na rede Tor!"
msgctxt "StatusEventWidget"
msgid "Directory Port Reachability Test Failed"
@@ -3573,16 +3583,23 @@ msgid ""
"port forwarding. If %1:%2 is not your correct IP address and directory port,"
" please check your relay's configuration."
msgstr ""
+"Sua porta do servidor relay não está alcançável por outros clientes Tor. "
+"Isso pode acontecer se você estiver atrás de um roteador ou firewall que "
+"requer que você configure o encaminhamento de porta. Se %1:%2 não é o seu "
+"endereço IP correto e a porta do servidor, por favor, verifique a "
+"configuração do seu relé."
msgctxt "StatusEventWidget"
msgid "Relay Descriptor Rejected"
-msgstr ""
+msgstr "Descritor do Relay Rejeitado"
msgctxt "StatusEventWidget"
msgid ""
"Your relay's descriptor, which enables clients to connect to your relay, was"
" rejected by the directory server at %1:%2. The reason given was: %3"
msgstr ""
+"Seu descritor de relay, que ativa clientes para conectar em seu relay, foi "
+"rejeitado pelo servidor de diretório em %1:%2. A razão dada foi %3."
msgctxt "StatusEventWidget"
msgid "Your Relay is Online"
diff --git a/ru/vidalia_ru.po b/ru/vidalia_ru.po
index a21330e..70fb758 100644
--- a/ru/vidalia_ru.po
+++ b/ru/vidalia_ru.po
@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: The Tor Project\n"
"Report-Msgid-Bugs-To: https://trac.torproject.org/projects/tor\n"
"POT-Creation-Date: 2011-09-07 14:40+0000\n"
-"PO-Revision-Date: 2012-01-31 20:45+0000\n"
+"PO-Revision-Date: 2012-01-31 20:46+0000\n"
"Last-Translator: liquixis <liquixis(a)gmail.com>\n"
"Language-Team: Russian (http://www.transifex.net/projects/p/torproject/team/ru/)\n"
"MIME-Version: 1.0\n"
@@ -3141,15 +3141,15 @@ msgstr "Нет нового использования"
msgctxt "ServerPage"
msgid "No clients have used your relay recently."
-msgstr "Нет клиентов недавно использовавших ваш сервер."
+msgstr "Нет клиентов недавно использовавших ваш ретранслятор."
msgctxt "ServerPage"
msgid ""
"Leave your relay running so clients have a better chance of finding and "
"using it."
msgstr ""
-"Оставьте ваш сервер работающим, так чтобы клиенты имели больше шансов найти "
-"и использовать его."
+"Оставьте ваш ретранслятор работающим, чтобы клиенты имели больше шансов "
+"найти и использовать его."
msgctxt "ServerPage"
msgid "Bridge History"
@@ -3189,15 +3189,15 @@ msgstr "Автоматически распространять адрес мо
msgctxt "ServerPage"
msgid "Mirror the Relay Directory"
-msgstr "Зеркалировать Каталог Серверов"
+msgstr "Зеркалировать каталог ретрансляторов"
msgctxt "ServerPage"
msgid ""
"Email address at which you may be reached if there is a\n"
"problem with your relay. You might also include your PGP or GPG fingerprint."
msgstr ""
-"Адрес электронной почты, по которому вас можно найти, если возникла проблема"
-" с вашим сервером. Вы также можете включить ваш PGP или GPG отпечаток."
+"Адрес электронной почты, по которому вас можно найти, если\n"
+"возникнет проблема с вашим ретранслятором. Вы также можете указать ваш PGP или GPG отпечаток."
msgctxt "ServicePage"
msgid "Error while trying to unpublish all services"
1
0

31 Jan '12
Author: phobos
Date: 2012-01-31 21:13:54 +0000 (Tue, 31 Jan 2012)
New Revision: 25362
Modified:
website/trunk/about/en/sponsors.wml
Log:
close missing a tag.
Modified: website/trunk/about/en/sponsors.wml
===================================================================
--- website/trunk/about/en/sponsors.wml 2012-01-31 21:06:59 UTC (rev 25361)
+++ website/trunk/about/en/sponsors.wml 2012-01-31 21:13:54 UTC (rev 25362)
@@ -54,7 +54,7 @@
<li><a href="http://www.hrw.org/">Human Rights Watch</a> (2007)</li>
<li><a href="http://www.torfox.org/">Torfox</a> (2009)</li>
<li><a href="http://www.shinjiru.com/">Shinjiru Technology</a> (2009-2011)</li>
- <li><a href="http://www.nationalchristian.com/">National Christian Foundation (2010-2012)</li>
+ <li><a href="http://www.nationalchristian.com/">National Christian Foundation</a> (2010-2012)</li>
</ul>
<h3>Past sponsors</h3>
1
0

31 Jan '12
Author: phobos
Date: 2012-01-31 21:06:59 +0000 (Tue, 31 Jan 2012)
New Revision: 25361
Modified:
website/trunk/about/en/sponsors.wml
Log:
update the sponsors.
Modified: website/trunk/about/en/sponsors.wml
===================================================================
--- website/trunk/about/en/sponsors.wml 2012-01-30 08:20:07 UTC (rev 25360)
+++ website/trunk/about/en/sponsors.wml 2012-01-31 21:06:59 UTC (rev 25361)
@@ -19,13 +19,13 @@
<h3><i>Magnoliophyta</i> (over $1 million)</h3>
<ul>
- <li>An anonymous North American NGO (2008-2011)</li>
+ <li>An anonymous North American NGO (2008-2012)</li>
<li><a href="http://www.bbg.gov/">Broadcasting Board of Governors</a> (2006-2011)</li>
</ul>
<h3><i>Liliopsida</i> (up to $750k)</h3>
<ul>
- <li><a href="http://www.sida.se/English/">Sida - Swedish International Development Cooperation Agency</a> (2010-2011)</li>
+ <li><a href="http://www.sida.se/English/">Sida - Swedish International Development Cooperation Agency</a> (2010-2012)</li>
</ul>
<h3><i>Asparagales</i> (up to $500k)</h3>
@@ -43,17 +43,18 @@
<ul>
<li><a href="http://www.nlnet.nl/">NLnet Foundation</a> (2008-2009)</li>
<li><a href="http://chacs.nrl.navy.mil/">Naval Research Laboratory</a> (2006-2010)</li>
- <li>An anonymous North American ISP (2009-2011)</li>
+ <li>An anonymous North American ISP (2009-2012)</li>
</ul>
<h3><i>Allium cepa</i> (up to $50k)</h3>
<ul>
- <li><a href="<page donate/donate>">More than 2700 personal donations from individuals like you</a> (2006-2011)</li>
+ <li><a href="<page donate/donate>">More than 2700 personal donations from individuals like you</a> (2006-2012)</li>
<li><a href="http://code.google.com/opensource/">Google</a> (2008-2009)</li>
<li><a href="http://code.google.com/soc/">Google Summer of Code</a> (2007-2011)</li>
<li><a href="http://www.hrw.org/">Human Rights Watch</a> (2007)</li>
<li><a href="http://www.torfox.org/">Torfox</a> (2009)</li>
- <li><a href="http://www.shinjiru.com/">Shinjiru Technology</a> (2009-2011)</li>
+ <li><a href="http://www.shinjiru.com/">Shinjiru Technology</a> (2009-2011)</li>
+ <li><a href="http://www.nationalchristian.com/">National Christian Foundation (2010-2012)</li>
</ul>
<h3>Past sponsors</h3>
1
0

[tor/master] Fix straggling MS_WINDOWS issues; add a changes file
by nickm@torproject.org 31 Jan '12
by nickm@torproject.org 31 Jan '12
31 Jan '12
commit 79a80c88eec9a9e1e81c1690de17e97e8a548dc1
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Tue Jan 31 11:04:27 2012 -0500
Fix straggling MS_WINDOWS issues; add a changes file
There was one MS_WINDOWS that remained because it wasn't on a macro
line; a few remaining uses (and the definition!) in configure.in;
and a now-nonsensical stanza of eventdns_tor.h that previously
defined 'WIN32' if it didn't exist.
---
changes/win32macro | 4 ++++
configure.in | 9 +++------
src/common/util.c | 2 +-
src/or/eventdns_tor.h | 5 -----
4 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/changes/win32macro b/changes/win32macro
new file mode 100644
index 0000000..402bb99
--- /dev/null
+++ b/changes/win32macro
@@ -0,0 +1,4 @@
+ o Code simplifications and refactoring:
+ - Use the _WIN32 macro throughout our code to detect Windows.
+ (Previously we had used the obsolete 'WIN32' and the
+ idiosyncratic 'MS_WINDOWS'.)
diff --git a/configure.in b/configure.in
index ddb6823..b97eba6 100644
--- a/configure.in
+++ b/configure.in
@@ -257,9 +257,6 @@ bwin32=true; AC_MSG_RESULT([yes]),
bwin32=false; AC_MSG_RESULT([no]))
fi
-if test "$bwin32" = true; then
-AC_DEFINE(MS_WINDOWS, 1, [Define to 1 if we are building for Windows.])
-fi
AM_CONDITIONAL(BUILD_NT_SERVICES, test x$bwin32 = xtrue)
dnl Enable C99 when compiling with MIPSpro
@@ -573,7 +570,7 @@ if test "$natpmp" = "true"; then
AC_DEFINE(NAT_PMP, 1, [Define to 1 if we are building with nat-pmp.])
TOR_SEARCH_LIBRARY(libnatpmp, $trylibnatpmpdir, [-lnatpmp $TOR_LIB_WS32 $TOR_LIB_IPHLPAPI],
[#include <natpmp.h>],
- [#ifdef MS_WINDOWS
+ [#ifdef _WIN32
#define STATICLIB
#endif
#include <natpmp.h>],
@@ -772,7 +769,7 @@ AC_CHECK_TYPES([struct in6_addr, struct sockaddr_in6, sa_family_t], , ,
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#define WIN32_WINNT 0x400
#define _WIN32_WINNT 0x400
#define WIN32_LEAN_AND_MEAN
@@ -797,7 +794,7 @@ AC_CHECK_MEMBERS([struct in6_addr.s6_addr32, struct in6_addr.s6_addr16, struct s
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#define WIN32_WINNT 0x400
#define _WIN32_WINNT 0x400
#define WIN32_LEAN_AND_MEAN
diff --git a/src/common/util.c b/src/common/util.c
index ac37f1b..52fea21 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -2972,7 +2972,7 @@ finish_daemon(const char *desired_cwd)
close(daemon_filedes[1]);
}
#else
-/* defined(MS_WINDOWS) */
+/* defined(_WIN32) */
void
start_daemon(void)
{
diff --git a/src/or/eventdns_tor.h b/src/or/eventdns_tor.h
index b3bdde0..c75cff2 100644
--- a/src/or/eventdns_tor.h
+++ b/src/or/eventdns_tor.h
@@ -14,11 +14,6 @@ typedef unsigned char u_char;
#endif
#include "torint.h"
-#if defined(_WIN32) && !defined(_WIN32)
-/* How did _this_ happen? */
-#define _WIN32
-#endif
-
/* These are for debugging possible memory leaks. */
#include "util.h"
#include "compat.h"
1
0

[tor/master] Use the standard _WIN32, not the Torism MS_WINDOWS or deprecated WIN32
by nickm@torproject.org 31 Jan '12
by nickm@torproject.org 31 Jan '12
31 Jan '12
commit 5cf9167f919dfef964b1d149731ed04941e25ebf
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Tue Jan 31 10:59:42 2012 -0500
Use the standard _WIN32, not the Torism MS_WINDOWS or deprecated WIN32
This commit is completely mechanical; I used this perl script to make it:
#!/usr/bin/perl -w -i.bak -p
if (/^\s*\#/) {
s/MS_WINDOWS/_WIN32/g;
s/\bWIN32\b/_WIN32/g;
}
---
src/common/address.c | 10 ++--
src/common/compat.c | 62 +++++++++++-----------
src/common/compat.h | 24 +++++-----
src/common/compat_libevent.c | 4 +-
src/common/crypto.c | 6 +-
src/common/procmon.c | 10 ++--
src/common/tortls.c | 4 +-
src/common/util.c | 64 ++++++++++++------------
src/common/util.h | 12 ++--
src/or/buffers.c | 4 +-
src/or/config.c | 22 ++++----
src/or/connection.c | 4 +-
src/or/control.c | 14 +++---
src/or/dns.c | 4 +-
src/or/eventdns.c | 14 +++---
src/or/eventdns.h | 2 +-
src/or/eventdns_tor.h | 6 +-
src/or/main.c | 24 +++++-----
src/or/ntmain.h | 2 +-
src/or/or.h | 4 +-
src/or/reasons.c | 2 +-
src/or/transports.c | 16 +++---
src/test/test-child.c | 6 +-
src/test/test.c | 4 +-
src/test/test_microdesc.c | 4 +-
src/test/test_util.c | 28 +++++-----
src/tools/tor-fw-helper/tor-fw-helper-natpmp.c | 4 +-
src/tools/tor-fw-helper/tor-fw-helper-upnp.c | 2 +-
src/tools/tor-fw-helper/tor-fw-helper.c | 4 +-
src/tools/tor-resolve.c | 2 +-
src/win32/orconfig.h | 3 +-
31 files changed, 185 insertions(+), 186 deletions(-)
diff --git a/src/common/address.c b/src/common/address.c
index e18ef95..17cda42 100644
--- a/src/common/address.c
+++ b/src/common/address.c
@@ -15,7 +15,7 @@
#include "torlog.h"
#include "container.h"
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#include <process.h>
#include <windows.h>
#include <winsock2.h>
@@ -275,7 +275,7 @@ tor_addr_lookup(const char *name, uint16_t family, tor_addr_t *addr)
ent = err ? NULL : &hent;
#else
ent = gethostbyname(name);
-#ifdef MS_WINDOWS
+#ifdef _WIN32
err = WSAGetLastError();
#else
err = h_errno;
@@ -291,7 +291,7 @@ tor_addr_lookup(const char *name, uint16_t family, tor_addr_t *addr)
}
return 0;
}
-#ifdef MS_WINDOWS
+#ifdef _WIN32
return (err == WSATRY_AGAIN) ? 1 : -1;
#else
return (err == TRY_AGAIN) ? 1 : -1;
@@ -1101,7 +1101,7 @@ tor_addr_port_lookup(const char *s, tor_addr_t *addr_out, uint16_t *port_out)
return -1;
}
-#ifdef MS_WINDOWS
+#ifdef _WIN32
typedef ULONG (WINAPI *GetAdaptersAddresses_fn_t)(
ULONG, ULONG, PVOID, PIP_ADAPTER_ADDRESSES, PULONG);
#endif
@@ -1140,7 +1140,7 @@ get_interface_addresses_raw(int severity)
freeifaddrs(ifa);
return result;
-#elif defined(MS_WINDOWS)
+#elif defined(_WIN32)
/* Windows XP began to provide GetAdaptersAddresses. Windows 2000 had a
"GetAdaptersInfo", but that's deprecated; let's just try
GetAdaptersAddresses and fall back to connect+getsockname.
diff --git a/src/common/compat.c b/src/common/compat.c
index cd11203..64c0668 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -21,7 +21,7 @@
#include "compat.h"
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#include <process.h>
#include <windows.h>
#include <sys/locking.h>
@@ -205,7 +205,7 @@ tor_munmap_file(tor_mmap_t *handle)
munmap((char*)handle->data, handle->mapping_size);
tor_free(handle);
}
-#elif defined(MS_WINDOWS)
+#elif defined(_WIN32)
tor_mmap_t *
tor_mmap_file(const char *filename)
{
@@ -341,7 +341,7 @@ tor_vsnprintf(char *str, size_t size, const char *format, va_list args)
return -1; /* no place for the NUL */
if (size > SIZE_T_CEILING)
return -1;
-#ifdef MS_WINDOWS
+#ifdef _WIN32
r = _vsnprintf(str, size, format, args);
#else
r = vsnprintf(str, size, format, args);
@@ -570,7 +570,7 @@ tor_strtok_r_impl(char *str, const char *sep, char **lasts)
return start;
}
-#ifdef MS_WINDOWS
+#ifdef _WIN32
/** Take a filename and return a pointer to its final element. This
* function is called on __FILE__ to fix a MSVC nit where __FILE__
* contains the full path to the file. This is bad, because it
@@ -670,7 +670,7 @@ set_uint64(void *cp, uint64_t v)
int
replace_file(const char *from, const char *to)
{
-#ifndef MS_WINDOWS
+#ifndef _WIN32
return rename(from,to);
#else
switch (file_status(to))
@@ -739,7 +739,7 @@ tor_lockfile_lock(const char *filename, int blocking, int *locked_out)
return NULL;
}
-#ifdef WIN32
+#ifdef _WIN32
_lseek(fd, 0, SEEK_SET);
if (_locking(fd, blocking ? _LK_LOCK : _LK_NBLCK, 1) < 0) {
if (errno != EACCES && errno != EDEADLOCK)
@@ -788,7 +788,7 @@ tor_lockfile_unlock(tor_lockfile_t *lockfile)
tor_assert(lockfile);
log_info(LD_FS, "Unlocking \"%s\"", lockfile->filename);
-#ifdef WIN32
+#ifdef _WIN32
_lseek(lockfile->fd, 0, SEEK_SET);
if (_locking(lockfile->fd, _LK_UNLCK, 1) < 0) {
log_warn(LD_FS,"Error unlocking \"%s\": %s", lockfile->filename,
@@ -824,7 +824,7 @@ tor_lockfile_unlock(tor_lockfile_t *lockfile)
off_t
tor_fd_getpos(int fd)
{
-#ifdef WIN32
+#ifdef _WIN32
return (off_t) _lseek(fd, 0, SEEK_CUR);
#else
return (off_t) lseek(fd, 0, SEEK_CUR);
@@ -835,7 +835,7 @@ tor_fd_getpos(int fd)
int
tor_fd_seekend(int fd)
{
-#ifdef WIN32
+#ifdef _WIN32
return _lseek(fd, 0, SEEK_END) < 0 ? -1 : 0;
#else
return lseek(fd, 0, SEEK_END) < 0 ? -1 : 0;
@@ -888,7 +888,7 @@ tor_close_socket(tor_socket_t s)
* tor_close_socket to close sockets, and always using close() on
* files.
*/
-#if defined(MS_WINDOWS)
+#if defined(_WIN32)
r = closesocket(s);
#else
r = close(s);
@@ -909,7 +909,7 @@ tor_close_socket(tor_socket_t s)
} else {
int err = tor_socket_errno(-1);
log_info(LD_NET, "Close returned an error: %s", tor_socket_strerror(err));
-#ifdef WIN32
+#ifdef _WIN32
if (err != WSAENOTSOCK)
--n_sockets_open;
#else
@@ -1016,7 +1016,7 @@ get_n_open_sockets(void)
void
set_socket_nonblocking(tor_socket_t socket)
{
-#if defined(MS_WINDOWS)
+#if defined(_WIN32)
unsigned long nonblocking = 1;
ioctlsocket(socket, FIONBIO, (unsigned long*) &nonblocking);
#else
@@ -1045,7 +1045,7 @@ int
tor_socketpair(int family, int type, int protocol, tor_socket_t fd[2])
{
//don't use win32 socketpairs (they are always bad)
-#if defined(HAVE_SOCKETPAIR) && !defined(MS_WINDOWS)
+#if defined(HAVE_SOCKETPAIR) && !defined(_WIN32)
int r;
#ifdef SOCK_CLOEXEC
type |= SOCK_CLOEXEC;
@@ -1089,7 +1089,7 @@ tor_socketpair(int family, int type, int protocol, tor_socket_t fd[2])
|| family != AF_UNIX
#endif
) {
-#ifdef MS_WINDOWS
+#ifdef _WIN32
return -WSAEAFNOSUPPORT;
#else
return -EAFNOSUPPORT;
@@ -1149,7 +1149,7 @@ tor_socketpair(int family, int type, int protocol, tor_socket_t fd[2])
return 0;
abort_tidy_up_and_fail:
-#ifdef MS_WINDOWS
+#ifdef _WIN32
saved_errno = WSAECONNABORTED;
#else
saved_errno = ECONNABORTED; /* I hope this is portable and appropriate. */
@@ -1191,7 +1191,7 @@ set_max_file_descriptors(rlim_t limit, int *max_out)
#if defined(CYGWIN) || defined(__CYGWIN__)
const char *platform = "Cygwin";
const unsigned long MAX_CONNECTIONS = 3200;
-#elif defined(MS_WINDOWS)
+#elif defined(_WIN32)
const char *platform = "Windows";
const unsigned long MAX_CONNECTIONS = 15000;
#else
@@ -1274,7 +1274,7 @@ set_max_file_descriptors(rlim_t limit, int *max_out)
return 0;
}
-#ifndef MS_WINDOWS
+#ifndef _WIN32
/** Log details of current user and group credentials. Return 0 on
* success. Logs and return -1 on failure.
*/
@@ -1380,7 +1380,7 @@ log_credential_status(void)
int
switch_id(const char *user)
{
-#ifndef MS_WINDOWS
+#ifndef _WIN32
struct passwd *pw = NULL;
uid_t old_uid;
gid_t old_gid;
@@ -1591,7 +1591,7 @@ get_parent_directory(char *fname)
char *cp;
int at_end = 1;
tor_assert(fname);
-#ifdef MS_WINDOWS
+#ifdef _WIN32
/* If we start with, say, c:, then don't consider that the start of the path
*/
if (fname[0] && fname[1] == ':') {
@@ -1608,7 +1608,7 @@ get_parent_directory(char *fname)
at_end = 1;
while (--cp > fname) {
int is_sep = (*cp == '/'
-#ifdef MS_WINDOWS
+#ifdef _WIN32
|| *cp == '\\'
#endif
);
@@ -1628,7 +1628,7 @@ get_parent_directory(char *fname)
char *
make_path_absolute(char *fname)
{
-#ifdef MS_WINDOWS
+#ifdef _WIN32
char *absfname_malloced = _fullpath(NULL, fname, 1);
/* We don't want to assume that tor_free can free a string allocated
@@ -1900,7 +1900,7 @@ tor_lookup_hostname(const char *name, uint32_t *addr)
void
tor_init_weak_random(unsigned seed)
{
-#ifdef MS_WINDOWS
+#ifdef _WIN32
srand(seed);
#else
srandom(seed);
@@ -1913,7 +1913,7 @@ tor_init_weak_random(unsigned seed)
long
tor_weak_random(void)
{
-#ifdef MS_WINDOWS
+#ifdef _WIN32
return rand();
#else
return random();
@@ -1942,7 +1942,7 @@ get_uname(void)
} else
#endif
{
-#ifdef MS_WINDOWS
+#ifdef _WIN32
OSVERSIONINFOEX info;
int i;
const char *plat = NULL;
@@ -2144,7 +2144,7 @@ spawn_exit(void)
static int
compute_num_cpus_impl(void)
{
-#ifdef MS_WINDOWS
+#ifdef _WIN32
SYSTEM_INFO info;
memset(&info, 0, sizeof(info));
GetSystemInfo(&info);
@@ -2192,7 +2192,7 @@ compute_num_cpus(void)
void
tor_gettimeofday(struct timeval *timeval)
{
-#ifdef MS_WINDOWS
+#ifdef _WIN32
/* Epoch bias copied from perl: number of units between windows epoch and
* Unix epoch. */
#define EPOCH_BIAS U64_LITERAL(116444736000000000)
@@ -2237,7 +2237,7 @@ tor_gettimeofday(struct timeval *timeval)
return;
}
-#if defined(TOR_IS_MULTITHREADED) && !defined(MS_WINDOWS)
+#if defined(TOR_IS_MULTITHREADED) && !defined(_WIN32)
/** Defined iff we need to add locks when defining fake versions of reentrant
* versions of time-related functions. */
#define TIME_FNS_NEED_LOCKS
@@ -2781,7 +2781,7 @@ in_main_thread(void)
* should call tor_socket_errno <em>at most once</em> on the failing
* socket to get the error.
*/
-#if defined(MS_WINDOWS)
+#if defined(_WIN32)
int
tor_socket_errno(tor_socket_t sock)
{
@@ -2797,7 +2797,7 @@ tor_socket_errno(tor_socket_t sock)
}
#endif
-#if defined(MS_WINDOWS)
+#if defined(_WIN32)
#define E(code, s) { code, (s " [" #code " ]") }
struct { int code; const char *msg; } windows_socket_errors[] = {
E(WSAEINTR, "Interrupted function call"),
@@ -2879,7 +2879,7 @@ tor_socket_strerror(int e)
int
network_init(void)
{
-#ifdef MS_WINDOWS
+#ifdef _WIN32
/* This silly exercise is necessary before windows will allow
* gethostbyname to work. */
WSADATA WSAData;
@@ -2901,7 +2901,7 @@ network_init(void)
return 0;
}
-#ifdef MS_WINDOWS
+#ifdef _WIN32
/** Return a newly allocated string describing the windows system error code
* <b>err</b>. Note that error codes are different from errno. Error codes
* come from GetLastError() when a winapi call fails. errno is set only when
diff --git a/src/common/compat.h b/src/common/compat.h
index 4329d45..fa1ef90 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -8,7 +8,7 @@
#include "orconfig.h"
#include "torint.h"
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#ifndef WIN32_WINNT
#define WIN32_WINNT 0x400
#endif
@@ -35,7 +35,7 @@
#ifdef HAVE_STRING_H
#include <string.h>
#endif
-#if defined(HAVE_PTHREAD_H) && !defined(MS_WINDOWS)
+#if defined(HAVE_PTHREAD_H) && !defined(_WIN32)
#include <pthread.h>
#endif
#include <stdarg.h>
@@ -89,7 +89,7 @@
#endif
/* inline is __inline on windows. */
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#define INLINE __inline
#else
#define INLINE inline
@@ -196,7 +196,7 @@ extern INLINE double U64_TO_DBL(uint64_t x) {
#endif
/* ===== String compatibility */
-#ifdef MS_WINDOWS
+#ifdef _WIN32
/* Windows names string functions differently from most other platforms. */
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
@@ -249,7 +249,7 @@ typedef struct tor_mmap_t {
#ifdef HAVE_SYS_MMAN_H
size_t mapping_size; /**< Size of the actual mapping. (This is this file
* size, rounded up to the nearest page.) */
-#elif defined MS_WINDOWS
+#elif defined _WIN32
HANDLE file_handle;
HANDLE mmap_handle;
#endif
@@ -307,7 +307,7 @@ char *tor_strtok_r_impl(char *str, const char *sep, char **lasts);
#define tor_strtok_r(str, sep, lasts) tor_strtok_r_impl(str, sep, lasts)
#endif
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#define _SHORT_FILE_ (tor_fix_source_file(__FILE__))
const char *tor_fix_source_file(const char *fname);
#else
@@ -386,7 +386,7 @@ void tor_lockfile_unlock(tor_lockfile_t *lockfile);
off_t tor_fd_getpos(int fd);
int tor_fd_seekend(int fd);
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#define PATH_SEPARATOR "\\"
#else
#define PATH_SEPARATOR "/"
@@ -398,7 +398,7 @@ int tor_fd_seekend(int fd);
typedef int socklen_t;
#endif
-#ifdef MS_WINDOWS
+#ifdef _WIN32
/* XXX Actually, this should arguably be SOCKET; we use intptr_t here so that
* any inadvertant checks for the socket being <= 0 or > 0 will probably
* still work. */
@@ -499,7 +499,7 @@ int network_init(void);
* errnos against expected values, and use tor_socket_errno to find
* the actual errno after a socket operation fails.
*/
-#if defined(MS_WINDOWS)
+#if defined(_WIN32)
/** Return true if e is EAGAIN or the local equivalent. */
#define ERRNO_IS_EAGAIN(e) ((e) == EAGAIN || (e) == WSAEWOULDBLOCK)
/** Return true if e is EINPROGRESS or the local equivalent. */
@@ -584,7 +584,7 @@ char *make_path_absolute(char *fname);
int spawn_func(void (*func)(void *), void *data);
void spawn_exit(void) ATTR_NORETURN;
-#if defined(ENABLE_THREADS) && defined(MS_WINDOWS)
+#if defined(ENABLE_THREADS) && defined(_WIN32)
#define USE_WIN32_THREADS
#define TOR_IS_MULTITHREADED 1
#elif (defined(ENABLE_THREADS) && defined(HAVE_PTHREAD_H) && \
@@ -666,14 +666,14 @@ void tor_cond_signal_all(tor_cond_t *cond);
#endif
/* Platform-specific helpers. */
-#ifdef MS_WINDOWS
+#ifdef _WIN32
char *format_win32_error(DWORD err);
#endif
/*for some reason my compiler doesn't have these version flags defined
a nice homework assignment for someone one day is to define the rest*/
//these are the values as given on MSDN
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#ifndef VER_SUITE_EMBEDDEDNT
#define VER_SUITE_EMBEDDEDNT 0x00000040
diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c
index 0cedef8..70e3baf 100644
--- a/src/common/compat_libevent.c
+++ b/src/common/compat_libevent.c
@@ -205,7 +205,7 @@ tor_libevent_initialize(tor_libevent_cfg *torcfg)
cfg = event_config_new();
tor_assert(cfg);
-#if defined(MS_WINDOWS) && defined(USE_BUFFEREVENTS)
+#if defined(_WIN32) && defined(USE_BUFFEREVENTS)
if (! torcfg->disable_iocp) {
evthread_use_windows_threads();
event_config_set_flag(cfg, EVENT_BASE_FLAG_STARTUP_IOCP);
@@ -241,7 +241,7 @@ tor_libevent_initialize(tor_libevent_cfg *torcfg)
/* This could be a socketpair() failure, which can happen sometimes on
* windows boxes with obnoxious firewall rules. Downgrade and try
* again. */
-#if defined(MS_WINDOWS) && defined(USE_BUFFEREVENTS)
+#if defined(_WIN32) && defined(USE_BUFFEREVENTS)
if (torcfg->disable_iocp == 0) {
log_warn(LD_GENERAL, "Unable to initialize Libevent. Trying again "
"with IOCP disabled.");
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 6bc54fc..380dcf0 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -12,7 +12,7 @@
#include "orconfig.h"
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#ifndef WIN32_WINNT
#define WIN32_WINNT 0x400
#endif
@@ -2409,7 +2409,7 @@ crypto_seed_rng(int startup)
int rand_poll_status = 0;
/* local variables */
-#ifdef MS_WINDOWS
+#ifdef _WIN32
unsigned char buf[ADD_ENTROPY];
static int provider_set = 0;
static HCRYPTPROV provider;
@@ -2431,7 +2431,7 @@ crypto_seed_rng(int startup)
log_warn(LD_CRYPTO, "RAND_poll() failed.");
}
-#ifdef MS_WINDOWS
+#ifdef _WIN32
if (!provider_set) {
if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT)) {
diff --git a/src/common/procmon.c b/src/common/procmon.c
index 5c10e9a..85d2a2f 100644
--- a/src/common/procmon.c
+++ b/src/common/procmon.c
@@ -21,7 +21,7 @@
#include <errno.h>
#endif
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#include <windows.h>
/* Windows does not define pid_t, but _getpid() returns an int. */
@@ -91,7 +91,7 @@ struct tor_process_monitor_t {
* polls. */
pid_t pid;
-#ifdef MS_WINDOWS
+#ifdef _WIN32
/** Windows-only: Should we poll hproc? If false, poll pid
* instead. */
int poll_hproc;
@@ -192,7 +192,7 @@ tor_process_monitor_new(struct event_base *base,
procmon->pid = ppspec.pid;
-#ifdef MS_WINDOWS
+#ifdef _WIN32
procmon->hproc = OpenProcess(PROCESS_QUERY_INFORMATION | SYNCHRONIZE,
FALSE,
procmon->pid);
@@ -246,7 +246,7 @@ tor_process_monitor_poll_cb(evutil_socket_t unused1, short unused2,
tor_assert(procmon != NULL);
-#ifdef MS_WINDOWS
+#ifdef _WIN32
if (procmon->poll_hproc) {
DWORD exit_code;
if (!GetExitCodeProcess(procmon->hproc, &exit_code)) {
@@ -323,7 +323,7 @@ tor_process_monitor_free(tor_process_monitor_t *procmon)
if (procmon == NULL)
return;
-#ifdef MS_WINDOWS
+#ifdef _WIN32
if (procmon->hproc != NULL)
CloseHandle(procmon->hproc);
#endif
diff --git a/src/common/tortls.c b/src/common/tortls.c
index 570dd00..26d3714 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -21,7 +21,7 @@
#endif
#include <assert.h>
-#ifdef MS_WINDOWS /*wrkard for dtls1.h >= 0.9.8m of "#include <winsock.h>"*/
+#ifdef _WIN32 /*wrkard for dtls1.h >= 0.9.8m of "#include <winsock.h>"*/
#ifndef WIN32_WINNT
#define WIN32_WINNT 0x400
#endif
@@ -333,7 +333,7 @@ tls_log_errors(tor_tls_t *tls, int severity, int domain, const char *doing)
static int
tor_errno_to_tls_error(int e)
{
-#if defined(MS_WINDOWS)
+#if defined(_WIN32)
switch (e) {
case WSAECONNRESET: // most common
return TOR_TLS_ERROR_CONNRESET;
diff --git a/src/common/util.c b/src/common/util.c
index 40efff0..ac37f1b 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -26,7 +26,7 @@
#include "container.h"
#include "address.h"
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#include <io.h>
#include <direct.h>
#include <process.h>
@@ -915,7 +915,7 @@ tor_parse_uint64(const char *s, int base, uint64_t min,
#ifdef HAVE_STRTOULL
r = (uint64_t)strtoull(s, &endptr, base);
-#elif defined(MS_WINDOWS)
+#elif defined(_WIN32)
#if defined(_MSC_VER) && _MSC_VER < 1300
tor_assert(base <= 10);
r = (uint64_t)_atoi64(s);
@@ -1731,7 +1731,7 @@ read_all(tor_socket_t fd, char *buf, size_t count, int isSocket)
static void
clean_name_for_stat(char *name)
{
-#ifdef MS_WINDOWS
+#ifdef _WIN32
size_t len = strlen(name);
if (!len)
return;
@@ -1790,7 +1790,7 @@ check_private_dir(const char *dirname, cpd_check_t check,
int r;
struct stat st;
char *f;
-#ifndef MS_WINDOWS
+#ifndef _WIN32
int mask;
struct passwd *pw = NULL;
uid_t running_uid;
@@ -1812,7 +1812,7 @@ check_private_dir(const char *dirname, cpd_check_t check,
}
if (check & CPD_CREATE) {
log_info(LD_GENERAL, "Creating directory %s", dirname);
-#if defined (MS_WINDOWS) && !defined (WINCE)
+#if defined (_WIN32) && !defined (WINCE)
r = mkdir(dirname);
#else
r = mkdir(dirname, 0700);
@@ -1834,7 +1834,7 @@ check_private_dir(const char *dirname, cpd_check_t check,
log_warn(LD_FS, "%s is not a directory", dirname);
return -1;
}
-#ifndef MS_WINDOWS
+#ifndef _WIN32
if (effective_user) {
/* Look up the user and group information.
* If we have a problem, bail out. */
@@ -1921,7 +1921,7 @@ check_private_dir(const char *dirname, cpd_check_t check,
int
write_str_to_file(const char *fname, const char *str, int bin)
{
-#ifdef MS_WINDOWS
+#ifdef _WIN32
if (!bin && strchr(str, '\r')) {
log_warn(LD_BUG,
"We're writing a text string that already contains a CR.");
@@ -2263,7 +2263,7 @@ read_file_to_str(const char *filename, int flags, struct stat *stat_out)
}
string[r] = '\0'; /* NUL-terminate the result. */
-#ifdef MS_WINDOWS
+#ifdef _WIN32
if (!bin && strchr(string, '\r')) {
log_debug(LD_FS, "We didn't convert CRLF to LF as well as we hoped "
"when reading %s. Coping.",
@@ -2544,7 +2544,7 @@ char *
expand_filename(const char *filename)
{
tor_assert(filename);
-#ifdef MS_WINDOWS
+#ifdef _WIN32
return tor_strdup(filename);
#else
if (*filename == '~') {
@@ -2780,7 +2780,7 @@ smartlist_t *
tor_listdir(const char *dirname)
{
smartlist_t *result;
-#ifdef MS_WINDOWS
+#ifdef _WIN32
char *pattern=NULL;
TCHAR tpattern[MAX_PATH] = {0};
char name[MAX_PATH] = {0};
@@ -2843,7 +2843,7 @@ path_is_relative(const char *filename)
{
if (filename && filename[0] == '/')
return 0;
-#ifdef MS_WINDOWS
+#ifdef _WIN32
else if (filename && filename[0] == '\\')
return 0;
else if (filename && strlen(filename)>3 && TOR_ISALPHA(filename[0]) &&
@@ -2858,7 +2858,7 @@ path_is_relative(const char *filename)
* Process helpers
* ===== */
-#ifndef MS_WINDOWS
+#ifndef _WIN32
/* Based on code contributed by christian grothoff */
/** True iff we've called start_daemon(). */
static int start_daemon_called = 0;
@@ -2995,7 +2995,7 @@ write_pidfile(char *filename)
log_warn(LD_FS, "Unable to open \"%s\" for writing: %s", filename,
strerror(errno));
} else {
-#ifdef MS_WINDOWS
+#ifdef _WIN32
fprintf(pidfile, "%d\n", (int)_getpid());
#else
fprintf(pidfile, "%d\n", (int)getpid());
@@ -3004,7 +3004,7 @@ write_pidfile(char *filename)
}
}
-#ifdef MS_WINDOWS
+#ifdef _WIN32
HANDLE
load_windows_system_library(const TCHAR *library_name)
{
@@ -3191,7 +3191,7 @@ format_helper_exit_status(unsigned char child_state, int saved_errno,
int
tor_terminate_process(process_handle_t *process_handle)
{
-#ifdef MS_WINDOWS
+#ifdef _WIN32
if (tor_get_exit_code(process_handle, 0, NULL) == PROCESS_EXIT_RUNNING) {
HANDLE handle;
/* If the signal is outside of what GenerateConsoleCtrlEvent can use,
@@ -3217,14 +3217,14 @@ tor_terminate_process(process_handle_t *process_handle)
int
tor_process_get_pid(process_handle_t *process_handle)
{
-#ifdef MS_WINDOWS
+#ifdef _WIN32
return (int) process_handle->pid.dwProcessId;
#else
return (int) process_handle->pid;
#endif
}
-#ifdef MS_WINDOWS
+#ifdef _WIN32
HANDLE
tor_process_get_stdout_pipe(process_handle_t *process_handle)
{
@@ -3243,7 +3243,7 @@ process_handle_new(void)
{
process_handle_t *out = tor_malloc_zero(sizeof(process_handle_t));
-#ifndef MS_WINDOWS
+#ifndef _WIN32
out->stdout_pipe = -1;
out->stderr_pipe = -1;
#endif
@@ -3284,14 +3284,14 @@ process_handle_new(void)
*/
int
tor_spawn_background(const char *const filename, const char **argv,
-#ifdef MS_WINDOWS
+#ifdef _WIN32
LPVOID envp,
#else
const char **envp,
#endif
process_handle_t **process_handle_out)
{
-#ifdef MS_WINDOWS
+#ifdef _WIN32
HANDLE stdout_pipe_read = NULL;
HANDLE stdout_pipe_write = NULL;
HANDLE stderr_pipe_read = NULL;
@@ -3393,7 +3393,7 @@ tor_spawn_background(const char *const filename, const char **argv,
/* TODO: Close pipes on exit */
*process_handle_out = process_handle;
return status;
-#else // MS_WINDOWS
+#else // _WIN32
pid_t pid;
int stdout_pipe[2];
int stderr_pipe[2];
@@ -3574,7 +3574,7 @@ tor_spawn_background(const char *const filename, const char **argv,
*process_handle_out = process_handle;
return process_handle->status;
-#endif // MS_WINDOWS
+#endif // _WIN32
}
/** Destroy all resources allocated by the process handle in
@@ -3600,7 +3600,7 @@ tor_process_handle_destroy(process_handle_t *process_handle,
process_handle->status = PROCESS_STATUS_NOTRUNNING;
-#ifdef MS_WINDOWS
+#ifdef _WIN32
if (process_handle->stdout_pipe)
CloseHandle(process_handle->stdout_pipe);
@@ -3632,7 +3632,7 @@ int
tor_get_exit_code(const process_handle_t *process_handle,
int block, int *exit_code)
{
-#ifdef MS_WINDOWS
+#ifdef _WIN32
DWORD retval;
BOOL success;
@@ -3687,12 +3687,12 @@ tor_get_exit_code(const process_handle_t *process_handle,
if (exit_code != NULL)
*exit_code = WEXITSTATUS(stat_loc);
-#endif // MS_WINDOWS
+#endif // _WIN32
return PROCESS_EXIT_EXITED;
}
-#ifdef MS_WINDOWS
+#ifdef _WIN32
/** Read from a handle <b>h</b> into <b>buf</b>, up to <b>count</b> bytes. If
* <b>hProcess</b> is NULL, the function will return immediately if there is
* nothing more to read. Otherwise <b>hProcess</b> should be set to the handle
@@ -3814,7 +3814,7 @@ ssize_t
tor_read_all_from_process_stdout(const process_handle_t *process_handle,
char *buf, size_t count)
{
-#ifdef MS_WINDOWS
+#ifdef _WIN32
return tor_read_all_handle(process_handle->stdout_pipe, buf, count,
process_handle);
#else
@@ -3828,7 +3828,7 @@ ssize_t
tor_read_all_from_process_stderr(const process_handle_t *process_handle,
char *buf, size_t count)
{
-#ifdef MS_WINDOWS
+#ifdef _WIN32
return tor_read_all_handle(process_handle->stderr_pipe, buf, count,
process_handle);
#else
@@ -3890,7 +3890,7 @@ tor_split_lines(smartlist_t *sl, char *buf, int len)
return smartlist_len(sl);
}
-#ifdef MS_WINDOWS
+#ifdef _WIN32
/** Read from stream, and send lines to log at the specified log level.
* Returns -1 if there is a error reading, and 0 otherwise.
* If the generated stream is flushed more often than on new lines, or
@@ -4103,7 +4103,7 @@ tor_check_port_forwarding(const char *filename, int dir_port, int or_port,
child_handle = NULL;
}
-#ifdef MS_WINDOWS
+#ifdef _WIN32
/* Passing NULL as lpApplicationName makes Windows search for the .exe */
status = tor_spawn_background(NULL, argv, NULL, &child_handle);
#else
@@ -4126,7 +4126,7 @@ tor_check_port_forwarding(const char *filename, int dir_port, int or_port,
if (child_handle && PROCESS_STATUS_RUNNING == child_handle->status) {
/* Read from stdout/stderr and log result */
retval = 0;
-#ifdef MS_WINDOWS
+#ifdef _WIN32
stdout_status = log_from_handle(child_handle->stdout_pipe, LOG_INFO);
stderr_status = log_from_handle(child_handle->stderr_pipe, LOG_WARN);
/* If we got this far (on Windows), the process started */
@@ -4146,7 +4146,7 @@ tor_check_port_forwarding(const char *filename, int dir_port, int or_port,
if (-1 == stdout_status || -1 == stderr_status)
/* There was a failure */
retval = -1;
-#ifdef MS_WINDOWS
+#ifdef _WIN32
else if (!child_handle || tor_get_exit_code(child_handle, 0, NULL) !=
PROCESS_EXIT_RUNNING) {
/* process has exited or there was an error */
diff --git a/src/common/util.h b/src/common/util.h
index b15b1ea..1bad24b 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -364,7 +364,7 @@ void tor_check_port_forwarding(const char *filename,
typedef struct process_handle_t process_handle_t;
int tor_spawn_background(const char *const filename, const char **argv,
-#ifdef MS_WINDOWS
+#ifdef _WIN32
LPVOID envp,
#else
const char **envp,
@@ -373,7 +373,7 @@ int tor_spawn_background(const char *const filename, const char **argv,
#define SPAWN_ERROR_MESSAGE "ERR: Failed to spawn background process - code "
-#ifdef MS_WINDOWS
+#ifdef _WIN32
HANDLE load_windows_system_library(const TCHAR *library_name);
#endif
@@ -388,7 +388,7 @@ HANDLE load_windows_system_library(const TCHAR *library_name);
/*DOCDOC*/
struct process_handle_t {
int status;
-#ifdef MS_WINDOWS
+#ifdef _WIN32
HANDLE stdout_pipe;
HANDLE stderr_pipe;
PROCESS_INFORMATION pid;
@@ -398,7 +398,7 @@ struct process_handle_t {
FILE *stdout_handle;
FILE *stderr_handle;
pid_t pid;
-#endif // MS_WINDOWS
+#endif // _WIN32
};
#endif
@@ -409,7 +409,7 @@ struct process_handle_t {
int tor_get_exit_code(const process_handle_t *process_handle,
int block, int *exit_code);
int tor_split_lines(struct smartlist_t *sl, char *buf, int len);
-#ifdef MS_WINDOWS
+#ifdef _WIN32
ssize_t tor_read_all_handle(HANDLE h, char *buf, size_t count,
const process_handle_t *process);
#else
@@ -424,7 +424,7 @@ ssize_t tor_read_all_from_process_stderr(
char *tor_join_win_cmdline(const char *argv[]);
int tor_process_get_pid(process_handle_t *process_handle);
-#ifdef MS_WINDOWS
+#ifdef _WIN32
HANDLE tor_process_get_stdout_pipe(process_handle_t *process_handle);
#else
FILE *tor_process_get_stdout_pipe(process_handle_t *process_handle);
diff --git a/src/or/buffers.c b/src/or/buffers.c
index dbecf12..d4fc44b 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -633,7 +633,7 @@ read_to_chunk(buf_t *buf, chunk_t *chunk, tor_socket_t fd, size_t at_most,
if (read_result < 0) {
int e = tor_socket_errno(fd);
if (!ERRNO_IS_EAGAIN(e)) { /* it's a real error */
-#ifdef MS_WINDOWS
+#ifdef _WIN32
if (e == WSAENOBUFS)
log_warn(LD_NET,"recv() failed: WSAENOBUFS. Not enough ram?");
#endif
@@ -790,7 +790,7 @@ flush_chunk(tor_socket_t s, buf_t *buf, chunk_t *chunk, size_t sz,
if (write_result < 0) {
int e = tor_socket_errno(s);
if (!ERRNO_IS_EAGAIN(e)) { /* it's a real error */
-#ifdef MS_WINDOWS
+#ifdef _WIN32
if (e == WSAENOBUFS)
log_warn(LD_NET,"write() failed: WSAENOBUFS. Not enough ram?");
#endif
diff --git a/src/or/config.c b/src/or/config.c
index 4b21b6c..d341d63 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -36,7 +36,7 @@
#include "util.h"
#include "routerlist.h"
#include "transports.h"
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#include <shlobj.h>
#endif
@@ -289,7 +289,7 @@ static config_var_t _option_vars[] = {
V(FetchHidServDescriptors, BOOL, "1"),
V(FetchUselessDescriptors, BOOL, "0"),
V(FetchV2Networkstatus, BOOL, "0"),
-#ifdef WIN32
+#ifdef _WIN32
V(GeoIPFile, FILENAME, "<default>"),
#else
V(GeoIPFile, FILENAME,
@@ -573,7 +573,7 @@ typedef struct {
*(uint32_t*)STRUCT_VAR_P(cfg,fmt->magic_offset)); \
STMT_END
-#ifdef MS_WINDOWS
+#ifdef _WIN32
static char *get_windows_conf_root(void);
#endif
static void config_line_append(config_line_t **lst,
@@ -1644,7 +1644,7 @@ options_act(const or_options_t *old_options)
* understand prefixes somehow. -NM */
/* XXXX023 Reload GeoIPFile on SIGHUP. -NM */
char *actual_fname = tor_strdup(options->GeoIPFile);
-#ifdef WIN32
+#ifdef _WIN32
if (!strcmp(actual_fname, "<default>")) {
const char *conf_root = get_windows_conf_root();
tor_free(actual_fname);
@@ -3357,7 +3357,7 @@ options_validate(or_options_t *old_options, or_options_t *options,
REJECT("Failed to resolve/guess local address. See logs for details.");
}
-#ifndef MS_WINDOWS
+#ifndef _WIN32
if (options->RunAsDaemon && torrc_fname && path_is_relative(torrc_fname))
REJECT("Can't use a relative path to torrc when RunAsDaemon is set.");
#endif
@@ -4247,7 +4247,7 @@ options_transition_affects_descriptor(const or_options_t *old_options,
return 0;
}
-#ifdef MS_WINDOWS
+#ifdef _WIN32
/** Return the directory on windows where we expect to find our application
* data. */
static char *
@@ -4310,7 +4310,7 @@ get_windows_conf_root(void)
static const char *
get_default_conf_file(int defaults_file)
{
-#ifdef MS_WINDOWS
+#ifdef _WIN32
if (defaults_file) {
static char defaults_path[MAX_PATH+1];
tor_snprintf(defaults_path, MAX_PATH, "%s\\torrc-defaults",
@@ -4400,7 +4400,7 @@ find_torrc_filename(int argc, char **argv,
if (dflt && file_status(dflt) == FN_FILE) {
fname = tor_strdup(dflt);
} else {
-#ifndef MS_WINDOWS
+#ifndef _WIN32
char *fn = NULL;
if (!defaults_file)
fn = expand_filename("~/.torrc");
@@ -4789,7 +4789,7 @@ options_init_logs(or_options_t *options, int validate_only)
int ok;
smartlist_t *elts;
int daemon =
-#ifdef MS_WINDOWS
+#ifdef _WIN32
0;
#else
options->RunAsDaemon;
@@ -5964,7 +5964,7 @@ check_server_ports(const smartlist_t *ports,
} else {
continue;
}
-#ifndef MS_WINDOWS
+#ifndef _WIN32
if (!port->no_advertise && port->port < 1024)
++n_low_port;
#endif
@@ -6041,7 +6041,7 @@ get_first_advertised_port_by_type_af(int listener_type, int address_family)
static int
normalize_data_directory(or_options_t *options)
{
-#ifdef MS_WINDOWS
+#ifdef _WIN32
char *p;
if (options->DataDirectory)
return 0; /* all set */
diff --git a/src/or/connection.c b/src/or/connection.c
index c51e7fb..bf65e8e 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -837,7 +837,7 @@ check_location_for_unix_socket(const or_options_t *options, const char *path)
static void
make_socket_reuseable(tor_socket_t sock)
{
-#ifdef MS_WINDOWS
+#ifdef _WIN32
(void) sock;
#else
int one=1;
@@ -1317,7 +1317,7 @@ connection_connect(connection_t *conn, const char *address,
* Warn if we do, and refuse to make the connection. */
static ratelim_t disablenet_violated = RATELIM_INIT(30*60);
char *m;
-#ifdef MS_WINDOWS
+#ifdef _WIN32
*socket_error = WSAENETUNREACH;
#else
*socket_error = ENETUNREACH;
diff --git a/src/or/control.c b/src/or/control.c
index b7c46e9..9a07777 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -34,7 +34,7 @@
#include "routerlist.h"
#include "routerparse.h"
-#ifndef MS_WINDOWS
+#ifndef _WIN32
#include <pwd.h>
#include <sys/resource.h>
#endif
@@ -542,7 +542,7 @@ control_ports_write_to_file(void)
log_warn(LD_CONTROL, "Writing %s failed: %s",
options->ControlPortWriteToFile, strerror(errno));
}
-#ifndef MS_WINDOWS
+#ifndef _WIN32
if (options->ControlPortFileGroupReadable) {
if (chmod(options->ControlPortWriteToFile, 0640)) {
log_warn(LD_FS,"Unable to make %s group-readable.",
@@ -1392,7 +1392,7 @@ getinfo_helper_misc(control_connection_t *conn, const char *question,
} else if (!strcmp(question, "process/pid")) {
int myPid = -1;
- #ifdef MS_WINDOWS
+ #ifdef _WIN32
myPid = _getpid();
#else
myPid = getpid();
@@ -1400,14 +1400,14 @@ getinfo_helper_misc(control_connection_t *conn, const char *question,
tor_asprintf(answer, "%d", myPid);
} else if (!strcmp(question, "process/uid")) {
- #ifdef MS_WINDOWS
+ #ifdef _WIN32
*answer = tor_strdup("-1");
#else
int myUid = geteuid();
tor_asprintf(answer, "%d", myUid);
#endif
} else if (!strcmp(question, "process/user")) {
- #ifdef MS_WINDOWS
+ #ifdef _WIN32
*answer = tor_strdup("");
#else
int myUid = geteuid();
@@ -1435,7 +1435,7 @@ getinfo_helper_misc(control_connection_t *conn, const char *question,
}
#elif defined(CYGWIN) || defined(__CYGWIN__)
*answer = tor_strdup("3200");
- #elif defined(MS_WINDOWS)
+ #elif defined(_WIN32)
*answer = tor_strdup("15000");
#else
*answer = tor_strdup("15000");
@@ -4231,7 +4231,7 @@ init_cookie_authentication(int enabled)
tor_free(fname);
return -1;
}
-#ifndef MS_WINDOWS
+#ifndef _WIN32
if (get_options()->CookieAuthFileGroupReadable) {
if (chmod(fname, 0640)) {
log_warn(LD_FS,"Unable to make %s group-readable.", escaped(fname));
diff --git a/src/or/dns.c b/src/or/dns.c
index ddf9841..2b7d3e3 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -1183,7 +1183,7 @@ configure_nameservers(int force)
int r;
options = get_options();
conf_fname = options->ServerDNSResolvConfFile;
-#ifndef MS_WINDOWS
+#ifndef _WIN32
if (!conf_fname)
conf_fname = "/etc/resolv.conf";
#endif
@@ -1251,7 +1251,7 @@ configure_nameservers(int force)
if (nameservers_configured)
evdns_base_resume(the_evdns_base);
}
-#ifdef MS_WINDOWS
+#ifdef _WIN32
else {
if (nameservers_configured) {
evdns_base_search_clear(the_evdns_base);
diff --git a/src/or/eventdns.c b/src/or/eventdns.c
index 7cd5d80..61a2836 100644
--- a/src/or/eventdns.c
+++ b/src/or/eventdns.c
@@ -96,7 +96,7 @@
#include "eventdns.h"
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
#include <winsock2.h>
#include <iphlpapi.h>
@@ -110,7 +110,7 @@
#include <netinet/in6.h>
#endif
-#ifdef WIN32
+#ifdef _WIN32
typedef int socklen_t;
#endif
@@ -343,7 +343,7 @@ static void server_port_ready_callback(int fd, short events, void *arg);
static int strtoint(const char *const str);
-#ifdef WIN32
+#ifdef _WIN32
static int
last_error(int sock)
{
@@ -432,7 +432,7 @@ _evdns_log(int warn, const char *fmt, ...)
if (!evdns_log_fn)
return;
va_start(args,fmt);
-#ifdef WIN32
+#ifdef _WIN32
_vsnprintf(buf, sizeof(buf), fmt, args);
#else
vsnprintf(buf, sizeof(buf), fmt, args);
@@ -2298,7 +2298,7 @@ _evdns_nameserver_add_impl(const struct sockaddr *address,
ns->socket = tor_open_socket(address->sa_family, SOCK_DGRAM, 0);
if (ns->socket < 0) { err = 1; goto out1; }
-#ifdef WIN32
+#ifdef _WIN32
{
u_long nonblocking = 1;
ioctlsocket(ns->socket, FIONBIO, &nonblocking);
@@ -3101,7 +3101,7 @@ out1:
return err;
}
-#ifdef WIN32
+#ifdef _WIN32
/* Add multiple nameservers from a space-or-comma-separated list. */
static int
evdns_nameserver_ip_add_line(const char *ips) {
@@ -3309,7 +3309,7 @@ int
evdns_init(void)
{
int res = 0;
-#ifdef WIN32
+#ifdef _WIN32
evdns_config_windows_nameservers();
#else
res = evdns_resolv_conf_parse(DNS_OPTIONS_ALL, "/etc/resolv.conf");
diff --git a/src/or/eventdns.h b/src/or/eventdns.h
index 3ff8bba..1c130b2 100644
--- a/src/or/eventdns.h
+++ b/src/or/eventdns.h
@@ -273,7 +273,7 @@ int evdns_resolve_reverse(const struct in_addr *in, int flags, evdns_callback_ty
int evdns_resolve_reverse_ipv6(const struct in6_addr *in, int flags, evdns_callback_type callback, void *ptr);
int evdns_set_option(const char *option, const char *val, int flags);
int evdns_resolv_conf_parse(int flags, const char *);
-#ifdef MS_WINDOWS
+#ifdef _WIN32
int evdns_config_windows_nameservers(void);
#endif
void evdns_search_clear(void);
diff --git a/src/or/eventdns_tor.h b/src/or/eventdns_tor.h
index 6a17893..b3bdde0 100644
--- a/src/or/eventdns_tor.h
+++ b/src/or/eventdns_tor.h
@@ -9,14 +9,14 @@ typedef unsigned int uint;
#ifndef HAVE_U_CHAR
typedef unsigned char u_char;
#endif
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#define inline __inline
#endif
#include "torint.h"
-#if defined(MS_WINDOWS) && !defined(WIN32)
+#if defined(_WIN32) && !defined(_WIN32)
/* How did _this_ happen? */
-#define WIN32
+#define _WIN32
#endif
/* These are for debugging possible memory leaks. */
diff --git a/src/or/main.c b/src/or/main.c
index e2480dc..7ef14aa 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -196,7 +196,7 @@ free_old_inbuf(connection_t *conn)
}
#endif
-#if defined(MS_WINDOWS) && defined(USE_BUFFEREVENTS)
+#if defined(_WIN32) && defined(USE_BUFFEREVENTS)
/** Remove the kernel-space send and receive buffers for <b>s</b>. For use
* with IOCP only. */
static int
@@ -237,7 +237,7 @@ connection_add_impl(connection_t *conn, int is_connecting)
if (connection_type_uses_bufferevent(conn)) {
if (SOCKET_OK(conn->s) && !conn->linked) {
-#ifdef MS_WINDOWS
+#ifdef _WIN32
if (tor_libevent_using_iocp_bufferevents() &&
get_options()->UserspaceIOCPBuffers) {
set_buffer_lengths_to_zero(conn->s);
@@ -701,7 +701,7 @@ conn_read_callback(evutil_socket_t fd, short event, void *_conn)
if (connection_handle_read(conn) < 0) {
if (!conn->marked_for_close) {
-#ifndef MS_WINDOWS
+#ifndef _WIN32
log_warn(LD_BUG,"Unhandled error on read for %s connection "
"(fd %d); removing",
conn_type_to_string(conn->type), (int)conn->s);
@@ -1689,7 +1689,7 @@ refill_callback(periodic_timer_t *timer, void *arg)
}
#endif
-#ifndef MS_WINDOWS
+#ifndef _WIN32
/** Called when a possibly ignorable libevent error occurs; ensures that we
* don't get into an infinite loop by ignoring too many errors from
* libevent. */
@@ -1908,7 +1908,7 @@ do_main_loop(void)
if (nt_service_is_stopping())
return 0;
-#ifndef MS_WINDOWS
+#ifndef _WIN32
/* Make it easier to tell whether libevent failure is our fault or not. */
errno = 0;
#endif
@@ -1932,7 +1932,7 @@ do_main_loop(void)
log_err(LD_NET,"libevent call with %s failed: %s [%d]",
tor_libevent_get_method(), tor_socket_strerror(e), e);
return -1;
-#ifndef MS_WINDOWS
+#ifndef _WIN32
} else if (e == EINVAL) {
log_warn(LD_NET, "EINVAL from libevent: should you upgrade libevent?");
if (got_libevent_error())
@@ -1951,7 +1951,7 @@ do_main_loop(void)
}
}
-#ifndef MS_WINDOWS /* Only called when we're willing to use signals */
+#ifndef _WIN32 /* Only called when we're willing to use signals */
/** Libevent callback: invoked when we get a signal.
*/
static void
@@ -2168,7 +2168,7 @@ exit_function(void)
{
/* NOTE: If we ever daemonize, this gets called immediately. That's
* okay for now, because we only use this on Windows. */
-#ifdef MS_WINDOWS
+#ifdef _WIN32
WSACleanup();
#endif
}
@@ -2177,7 +2177,7 @@ exit_function(void)
void
handle_signals(int is_parent)
{
-#ifndef MS_WINDOWS /* do signal stuff only on Unix */
+#ifndef _WIN32 /* do signal stuff only on Unix */
int i;
static const int signals[] = {
SIGINT, /* do a controlled slow shutdown */
@@ -2300,7 +2300,7 @@ tor_init(int argc, char *argv[])
return -1;
}
-#ifndef MS_WINDOWS
+#ifndef _WIN32
if (geteuid()==0)
log_warn(LD_GENERAL,"You are running Tor as root. You don't need to, "
"and you probably shouldn't.");
@@ -2342,7 +2342,7 @@ try_locking(const or_options_t *options, int err_if_locked)
log_warn(LD_GENERAL, "It looks like another Tor process is running "
"with the same data directory. Waiting 5 seconds to see "
"if it goes away.");
-#ifndef WIN32
+#ifndef _WIN32
sleep(5);
#else
Sleep(5000);
@@ -2578,7 +2578,7 @@ tor_main(int argc, char *argv[])
}
#endif
-#ifdef MS_WINDOWS
+#ifdef _WIN32
/* Call SetProcessDEPPolicy to permanently enable DEP.
The function will not resolve on earlier versions of Windows,
and failure is not dangerous. */
diff --git a/src/or/ntmain.h b/src/or/ntmain.h
index acd0e1d..6d95a09 100644
--- a/src/or/ntmain.h
+++ b/src/or/ntmain.h
@@ -12,7 +12,7 @@
#ifndef _TOR_NTMAIN_H
#define _TOR_NTMAIN_H
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#if !defined (WINCE)
#define NT_SERVICE
#endif
diff --git a/src/or/or.h b/src/or/or.h
index 9ac8717..33324f5 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -22,7 +22,7 @@
#endif
#endif
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#ifndef WIN32_WINNT
#define WIN32_WINNT 0x400
#endif
@@ -79,7 +79,7 @@
#include <time.h>
#endif
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#include <io.h>
#include <process.h>
#include <direct.h>
diff --git a/src/or/reasons.c b/src/or/reasons.c
index 319e6c0..bcf15ff 100644
--- a/src/or/reasons.c
+++ b/src/or/reasons.c
@@ -143,7 +143,7 @@ stream_end_reason_to_socks5_response(int reason)
* E_CASE is for errors where windows has both a EFOO and a WSAEFOO
* version, and S_CASE is for errors where windows has only a WSAEFOO
* version. (The E is for 'error', the S is for 'socket'). */
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#define E_CASE(s) case s: case WSA ## s
#define S_CASE(s) case WSA ## s
#else
diff --git a/src/or/transports.c b/src/or/transports.c
index 0bc67ba..3e5501e 100644
--- a/src/or/transports.c
+++ b/src/or/transports.c
@@ -91,7 +91,7 @@
#include "util.h"
#include "router.h"
-#ifdef MS_WINDOWS
+#ifdef _WIN32
static void set_managed_proxy_environment(LPVOID *envp,
const managed_proxy_t *mp);
#else
@@ -263,7 +263,7 @@ launch_managed_proxy(managed_proxy_t *mp)
{
int retval;
-#ifdef MS_WINDOWS
+#ifdef _WIN32
LPVOID envp=NULL;
@@ -349,7 +349,7 @@ pt_configure_remaining_proxies(void)
} SMARTLIST_FOREACH_END(mp);
}
-#ifdef MS_WINDOWS
+#ifdef _WIN32
/** Attempt to continue configuring managed proxy <b>mp</b>. */
static void
@@ -406,7 +406,7 @@ configure_proxy(managed_proxy_t *mp)
smartlist_free(lines);
}
-#else /* MS_WINDOWS */
+#else /* _WIN32 */
/** Attempt to continue configuring managed proxy <b>mp</b>. */
static void
@@ -451,7 +451,7 @@ configure_proxy(managed_proxy_t *mp)
}
}
-#endif /* MS_WINDOWS */
+#endif /* _WIN32 */
/** Register server managed proxy <b>mp</b> transports to state */
static void
@@ -941,7 +941,7 @@ get_bindaddr_for_server_proxy(const managed_proxy_t *mp)
return bindaddr_result;
}
-#ifdef MS_WINDOWS
+#ifdef _WIN32
/** Prepare the environment <b>envp</b> of managed proxy <b>mp</b>.
* <b>envp</b> is allocated on the heap and should be freed by the
@@ -1043,7 +1043,7 @@ set_managed_proxy_environment(LPVOID *envp, const managed_proxy_t *mp)
smartlist_free(envs);
}
-#else /* MS_WINDOWS */
+#else /* _WIN32 */
/** Prepare the environment <b>envp</b> of managed proxy <b>mp</b>.
* <b>envp</b> is allocated on the heap and should be freed by the
@@ -1104,7 +1104,7 @@ set_managed_proxy_environment(char ***envp, const managed_proxy_t *mp)
return r;
}
-#endif /* MS_WINDOWS */
+#endif /* _WIN32 */
/** Create and return a new managed proxy for <b>transport</b> using
* <b>proxy_argv</b>. If <b>is_server</b> is true, it's a server
diff --git a/src/test/test-child.c b/src/test/test-child.c
index 1b9c5e3..b57d8ca 100644
--- a/src/test/test-child.c
+++ b/src/test/test-child.c
@@ -1,6 +1,6 @@
#include <stdio.h>
#include "orconfig.h"
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#define WINDOWS_LEAN_AND_MEAN
#include <windows.h>
#else
@@ -23,13 +23,13 @@ main(int argc, char **argv)
succeed. Otherwise ReadFile() will get the entire output in one */
// XXX: Can we make stdio flush on newline?
fflush(stdout);
-#ifdef MS_WINDOWS
+#ifdef _WIN32
Sleep(1000);
#else
sleep(1);
#endif
fprintf(stdout, "DONE\n");
-#ifdef MS_WINDOWS
+#ifdef _WIN32
Sleep(1000);
#else
sleep(1);
diff --git a/src/test/test.c b/src/test/test.c
index 9d369c0..2ecf6ff 100644
--- a/src/test/test.c
+++ b/src/test/test.c
@@ -19,7 +19,7 @@ const char tor_git_revision[] = "";
#include <fcntl.h>
#endif
-#ifdef MS_WINDOWS
+#ifdef _WIN32
/* For mkdir() */
#include <direct.h>
#else
@@ -83,7 +83,7 @@ setup_directory(void)
int r;
if (is_setup) return;
-#ifdef MS_WINDOWS
+#ifdef _WIN32
{
char buf[MAX_PATH];
const char *tmp = buf;
diff --git a/src/test/test_microdesc.c b/src/test/test_microdesc.c
index dcc6f9c..9326c03 100644
--- a/src/test/test_microdesc.c
+++ b/src/test/test_microdesc.c
@@ -9,7 +9,7 @@
#include "test.h"
-#ifdef MS_WINDOWS
+#ifdef _WIN32
/* For mkdir() */
#include <direct.h>
#else
@@ -66,7 +66,7 @@ test_md_cache(void *data)
/* Possibly, turn this into a test setup/cleanup pair */
tor_free(options->DataDirectory);
options->DataDirectory = tor_strdup(get_fname("md_datadir_test"));
-#ifdef MS_WINDOWS
+#ifdef _WIN32
tt_int_op(0, ==, mkdir(options->DataDirectory));
#else
tt_int_op(0, ==, mkdir(options->DataDirectory, 0700));
diff --git a/src/test/test_util.c b/src/test/test_util.c
index 670d87d..508c155 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -530,7 +530,7 @@ test_util_threads(void)
char *s1 = NULL, *s2 = NULL;
int done = 0, timedout = 0;
time_t started;
-#ifndef MS_WINDOWS
+#ifndef _WIN32
struct timeval tv;
tv.tv_sec=0;
tv.tv_usec=10;
@@ -564,7 +564,7 @@ test_util_threads(void)
timedout = done = 1;
}
tor_mutex_release(_thread_test_mutex);
-#ifndef MS_WINDOWS
+#ifndef _WIN32
/* Prevent the main thread from starving the worker threads. */
select(0, NULL, NULL, NULL, &tv);
#endif
@@ -735,7 +735,7 @@ test_util_mmap(void)
test_assert(mapping);
test_eq(mapping->size, strlen("Short file."));
test_streq(mapping->data, "Short file.");
-#ifdef MS_WINDOWS
+#ifdef _WIN32
tor_munmap_file(mapping);
mapping = NULL;
test_assert(unlink(fname1) == 0);
@@ -1260,7 +1260,7 @@ test_util_parent_dir(void *ptr)
tor_free(cp);
}
-#ifdef MS_WINDOWS
+#ifdef _WIN32
static void
test_util_load_win_lib(void *ptr)
{
@@ -1312,7 +1312,7 @@ test_util_exit_status(void *ptr)
;
}
-#ifndef MS_WINDOWS
+#ifndef _WIN32
/** Check that fgets waits until a full line, and not return a partial line, on
* a EAGAIN with a non-blocking pipe */
static void
@@ -1412,7 +1412,7 @@ run_util_spawn_background(const char *argv[], const char *expected_out,
int status;
/* Start the program */
-#ifdef MS_WINDOWS
+#ifdef _WIN32
status = tor_spawn_background(NULL, argv, NULL, &process_handle);
#else
status = tor_spawn_background(argv[0], argv, NULL, &process_handle);
@@ -1459,7 +1459,7 @@ run_util_spawn_background(const char *argv[], const char *expected_out,
static void
test_util_spawn_background_ok(void *ptr)
{
-#ifdef MS_WINDOWS
+#ifdef _WIN32
const char *argv[] = {"test-child.exe", "--test", NULL};
const char *expected_out = "OUT\r\n--test\r\nSLEEPING\r\nDONE\r\n";
const char *expected_err = "ERR\r\n";
@@ -1483,7 +1483,7 @@ test_util_spawn_background_fail(void *ptr)
const char *expected_err = "";
char expected_out[1024];
char code[32];
-#ifdef MS_WINDOWS
+#ifdef _WIN32
const int expected_status = PROCESS_STATUS_ERROR;
#else
/* TODO: Once we can signal failure to exec, set this to be
@@ -1515,7 +1515,7 @@ test_util_spawn_background_partial_read(void *ptr)
process_handle_t *process_handle=NULL;
int status;
char stdout_buf[100], stderr_buf[100];
-#ifdef MS_WINDOWS
+#ifdef _WIN32
const char *argv[] = {"test-child.exe", "--test", NULL};
const char *expected_out[] = { "OUT\r\n--test\r\nSLEEPING\r\n",
"DONE\r\n",
@@ -1533,7 +1533,7 @@ test_util_spawn_background_partial_read(void *ptr)
(void)ptr;
/* Start the program */
-#ifdef MS_WINDOWS
+#ifdef _WIN32
status = tor_spawn_background(NULL, argv, NULL, &process_handle);
#else
status = tor_spawn_background(argv[0], argv, NULL, &process_handle);
@@ -1544,7 +1544,7 @@ test_util_spawn_background_partial_read(void *ptr)
/* Check stdout */
for (expected_out_ctr = 0; expected_out[expected_out_ctr] != NULL;) {
-#ifdef MS_WINDOWS
+#ifdef _WIN32
pos = tor_read_all_handle(process_handle->stdout_pipe, stdout_buf,
sizeof(stdout_buf) - 1, NULL);
#else
@@ -1567,7 +1567,7 @@ test_util_spawn_background_partial_read(void *ptr)
}
/* The process should have exited without writing more */
-#ifdef MS_WINDOWS
+#ifdef _WIN32
pos = tor_read_all_handle(process_handle->stdout_pipe, stdout_buf,
sizeof(stdout_buf) - 1,
process_handle);
@@ -1881,11 +1881,11 @@ struct testcase_t util_tests[] = {
UTIL_TEST(asprintf, 0),
UTIL_TEST(listdir, 0),
UTIL_TEST(parent_dir, 0),
-#ifdef MS_WINDOWS
+#ifdef _WIN32
UTIL_TEST(load_win_lib, 0),
#endif
UTIL_TEST(exit_status, 0),
-#ifndef MS_WINDOWS
+#ifndef _WIN32
UTIL_TEST(fgets_eagain, TT_SKIP),
#endif
UTIL_TEST(spawn_background_ok, 0),
diff --git a/src/tools/tor-fw-helper/tor-fw-helper-natpmp.c b/src/tools/tor-fw-helper/tor-fw-helper-natpmp.c
index a3a52d1..ed79fd2 100644
--- a/src/tools/tor-fw-helper/tor-fw-helper-natpmp.c
+++ b/src/tools/tor-fw-helper/tor-fw-helper-natpmp.c
@@ -9,14 +9,14 @@
#include "orconfig.h"
#ifdef NAT_PMP
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#define STATICLIB
#endif
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
-#ifndef MS_WINDOWS
+#ifndef _WIN32
#include <arpa/inet.h>
#endif
diff --git a/src/tools/tor-fw-helper/tor-fw-helper-upnp.c b/src/tools/tor-fw-helper/tor-fw-helper-upnp.c
index c4b14a8..442eae5 100644
--- a/src/tools/tor-fw-helper/tor-fw-helper-upnp.c
+++ b/src/tools/tor-fw-helper/tor-fw-helper-upnp.c
@@ -9,7 +9,7 @@
#include "orconfig.h"
#ifdef MINIUPNPC
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#define STATICLIB
#endif
#include <stdint.h>
diff --git a/src/tools/tor-fw-helper/tor-fw-helper.c b/src/tools/tor-fw-helper/tor-fw-helper.c
index 0022397..ea5ae7f 100644
--- a/src/tools/tor-fw-helper/tor-fw-helper.c
+++ b/src/tools/tor-fw-helper/tor-fw-helper.c
@@ -21,7 +21,7 @@
#include <time.h>
#include <string.h>
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#include <winsock2.h>
#endif
@@ -229,7 +229,7 @@ tor_fw_add_dir_port(tor_fw_options_t *tor_fw_options,
static int
network_init(void)
{
-#ifdef MS_WINDOWS
+#ifdef _WIN32
/* This silly exercise is necessary before windows will allow
* gethostbyname to work. */
WSADATA WSAData;
diff --git a/src/tools/tor-resolve.c b/src/tools/tor-resolve.c
index f1220d9..73352fe 100644
--- a/src/tools/tor-resolve.c
+++ b/src/tools/tor-resolve.c
@@ -32,7 +32,7 @@
#include <errno.h>
#endif
-#ifdef MS_WINDOWS
+#ifdef _WIN32
#if defined(_MSC_VER) && (_MSC_VER <= 1300)
#include <winsock.h>
#else
diff --git a/src/win32/orconfig.h b/src/win32/orconfig.h
index 9891c8e..bf33c81 100644
--- a/src/win32/orconfig.h
+++ b/src/win32/orconfig.h
@@ -3,8 +3,7 @@
*/
/* Windows-only defines. */
-#define MS_WINDOWS
-#define MS_WIN32
+#define _WIN32
#define CONFDIR ""
/* Define to 1 if you have the <arpa/inet.h> header file. */
1
0